Disable clocks on riscv64

https://bugs.ruby-lang.org/issues/16007
324dd9d01f

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 <top (required)>'
/builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:4:in `<top (required)>'
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 <top (required)>'
/builddir/build/BUILD/ruby-2.7.1/spec/ruby/core/process/clock_getres_spec.rb:4:in `<top (required)>'
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 <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2020-05-02 22:24:17 +03:00
parent 120ff99bc9
commit 3e5b20e2a9
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 19 additions and 0 deletions

View File

@ -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)
}

View File

@ -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: