From 3e5b20e2a967f2fb2061251c5a9a82450dc0919c Mon Sep 17 00:00:00 2001 From: David Abdurachmanov Date: Sat, 2 May 2020 22:24:17 +0300 Subject: [PATCH] Disable clocks on riscv64 https://bugs.ruby-lang.org/issues/16007 https://github.com/ruby/ruby/commit/324dd9d01f0c97631a2588f63231bcb651844cca 1) Process.clock_getres matches the clock in practice for Process::CLOCK_PROCESS_CPUTIME_ID FAILED Expected 10000 == 10000 to be falsy but was true /builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:27:in `block (4 levels) in ' /builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:4:in `' 2) Process.clock_getres matches the clock in practice for Process::CLOCK_THREAD_CPUTIME_ID FAILED Expected 10000 == 10000 to be falsy but was true /builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:27:in `block (4 levels) in ' /builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:4:in `' Finished in 2010.323383 seconds 3746 files, 30427 examples, 111183 expectations, 2 failures, 0 errors, 3 tagged make: *** [uncommon.mk:823: yes-test-spec] Error 1 Signed-off-by: David Abdurachmanov --- ruby-2.7.1-disable-riscv64-clocks.patch | 13 +++++++++++++ ruby.spec | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 ruby-2.7.1-disable-riscv64-clocks.patch diff --git a/ruby-2.7.1-disable-riscv64-clocks.patch b/ruby-2.7.1-disable-riscv64-clocks.patch new file mode 100644 index 0000000..88e925b --- /dev/null +++ b/ruby-2.7.1-disable-riscv64-clocks.patch @@ -0,0 +1,13 @@ +diff --git a/spec/ruby/core/process/fixtures/clocks.rb b/spec/ruby/core/process/fixtures/clocks.rb +index 7537cfa..c4c647a 100644 +--- a/spec/ruby/core/process/fixtures/clocks.rb ++++ b/spec/ruby/core/process/fixtures/clocks.rb +@@ -34,7 +34,7 @@ module ProcessSpecs + end + + # These clocks in practice on ARM on Linux do not seem to match their reported resolution. +- platform_is :armv7, :armv8, :aarch64 do ++ platform_is :armv7, :armv8, :aarch64, :riscv64 do + clocks = clocks.reject { |clock, value| + [:CLOCK_PROCESS_CPUTIME_ID, :CLOCK_THREAD_CPUTIME_ID, :CLOCK_MONOTONIC_RAW].include?(clock) + } diff --git a/ruby.spec b/ruby.spec index 10c1030..cd91a64 100644 --- a/ruby.spec +++ b/ruby.spec @@ -162,6 +162,11 @@ Patch22: ruby-2.6.0-config-support-include-directive.patch # Disable pthread assert on Linux RISC-V (riscv64) Patch30: abe2e7de4d1f2d5861d7c9ab9c7e778f2ee1dcd2.patch +# Same as for ARM. +# See: https://bugs.ruby-lang.org/issues/16007 +# https://github.com/ruby/ruby/commit/324dd9d01f0c97631a2588f63231bcb651844cca +Patch31: ruby-2.7.1-disable-riscv64-clocks.patch + Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick Recommends: ruby(rubygems) >= %{rubygems_version} @@ -574,6 +579,7 @@ rm -rf ext/fiddle/libffi* %ifarch riscv64 %patch30 -p1 +%patch31 -p1 %endif # Provide an example of usage of the tapset: