Summary: | =dev-ruby/ffi-1.15.5 on sparc with >=dev-lang/ruby-3: ArgumentError: wrong number of arguments (given 2, expected 1) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | matoro <matoro_bugzilla_gentoo> |
Component: | Current packages | Assignee: | Gentoo Ruby Team <ruby> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | matoro_bugzilla_gentoo, sparc, xtkoba |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | Sparc | ||
OS: | Linux | ||
URL: | https://github.com/ffi/ffi/pull/957 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
build.log
dev-ruby/ffi-1.15.5: Reproduce #847286 on major platforms |
Description
matoro
2022-05-24 17:53:17 UTC
Created attachment 780572 [details]
build.log
Created attachment 780578 [details, diff]
dev-ruby/ffi-1.15.5: Reproduce #847286 on major platforms
This does not happen on "major" platforms for which the pre-generated types.conf exists under lib/ffi/platform/. With the attached patch applied to the ebuild file, this reproduces on my x86_64-linux-gnu environment.
Fix should be fairly straightforward.
(In reply to Tee KOBAYASHI from comment #2) > Created attachment 780578 [details, diff] [details, diff] > dev-ruby/ffi-1.15.5: Reproduce #847286 on major platforms > > This does not happen on "major" platforms for which the pre-generated > types.conf exists under lib/ffi/platform/. With the attached patch applied > to the ebuild file, this reproduces on my x86_64-linux-gnu environment. > > Fix should be fairly straightforward. Thanks, this is interesting because there is actually a pregenerated types.conf at lib/ffi/platform/sparc64-linux, unless I'm missing something? (In reply to matoro from comment #3) > Thanks, this is interesting because there is actually a pregenerated > types.conf at lib/ffi/platform/sparc64-linux, unless I'm missing something? See the build log. The build system is trying to generate lib/ffi/platform/sparcv9-linux/types.conf which does not exist. I do not know whether it is an expected or unexpected behavior to use "sparcv9-linux" as the target name instead of "sparc64-linux". (In reply to Tee KOBAYASHI from comment #4) > (In reply to matoro from comment #3) > > Thanks, this is interesting because there is actually a pregenerated > > types.conf at lib/ffi/platform/sparc64-linux, unless I'm missing something? > > See the build log. The build system is trying to generate > lib/ffi/platform/sparcv9-linux/types.conf which does not exist. I do not > know whether it is an expected or unexpected behavior to use "sparcv9-linux" > as the target name instead of "sparc64-linux". Thanks, that was the clue I needed! In https://github.com/ffi/ffi/pull/575 , sparc64 was changed to sparcv9, but the directory in lib/ffi/platform was never renamed. Sending a patch upstream shortly. (In reply to Tee KOBAYASHI from comment #4) > (In reply to matoro from comment #3) > > Thanks, this is interesting because there is actually a pregenerated > > types.conf at lib/ffi/platform/sparc64-linux, unless I'm missing something? > > See the build log. The build system is trying to generate > lib/ffi/platform/sparcv9-linux/types.conf which does not exist. I do not > know whether it is an expected or unexpected behavior to use "sparcv9-linux" > as the target name instead of "sparc64-linux". There is one more issue, even after fixing this, two of the tests are failing and I'm not quite sure why. Failures: 1) Callback interop from ffi to ffi Failure/Error: LibTestFFI.testCallbackVrV(FFI::Pointer.new(func.to_i)) RangeError: bignum too big to convert into `long long' # ./spec/ffi/callback_spec.rb:883:in `initialize' # ./spec/ffi/callback_spec.rb:883:in `new' # ./spec/ffi/callback_spec.rb:883:in `block (3 levels) in <module:CallbackInteropSpecs>' # ./spec/ffi/callback_spec.rb:872:in `assert_callback_in_same_thread_called_once' # ./spec/ffi/callback_spec.rb:881:in `block (2 levels) in <module:CallbackInteropSpecs>' 2) Callback interop from ffi to ffi with blocking:true Failure/Error: LibTestFFI.testCallbackVrV_blocking(FFI::Pointer.new(func.to_i)) RangeError: bignum too big to convert into `long long' # ./spec/ffi/callback_spec.rb:890:in `initialize' # ./spec/ffi/callback_spec.rb:890:in `new' # ./spec/ffi/callback_spec.rb:890:in `block (3 levels) in <module:CallbackInteropSpecs>' # ./spec/ffi/callback_spec.rb:872:in `assert_callback_in_same_thread_called_once' # ./spec/ffi/callback_spec.rb:888:in `block (2 levels) in <module:CallbackInteropSpecs>' Finished in 6.9 seconds (files took 18.85 seconds to load) 4944 examples, 2 failures Failed examples: rspec ./spec/ffi/callback_spec.rb:880 # Callback interop from ffi to ffi rspec ./spec/ffi/callback_spec.rb:887 # Callback interop from ffi to ffi with blocking:true I added a debug print line to print the value of the function pointer that FFI generates and it gives: #<FFI::Function address=0xfff80001000d4000 size=48> which definitely seems wrong, that address is indeed outside the 64-bit range - I don't know how it's possible to even generate that. Would you happen to have any idea? Fixed upstream with https://github.com/ffi/ffi/pull/962. When combined with my changes in https://github.com/ffi/ffi/pull/957, everything checks out. Will include this in my Ruby work in https://github.com/gentoo/gentoo/pull/25906. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4cf664faf645b70935eaee5124eb2a13e35edc44 commit 4cf664faf645b70935eaee5124eb2a13e35edc44 Author: matoro <matoro@users.noreply.github.com> AuthorDate: 2022-06-15 04:29:18 +0000 Commit: Matt Turner <mattst88@gentoo.org> CommitDate: 2022-10-22 21:33:10 +0000 dev-ruby/ffi: revbump 1.15.5-r1, fix sparc See: https://github.com/ffi/ffi/pull/957 Closes: https://bugs.gentoo.org/847286 Signed-off-by: matoro <matoro@users.noreply.github.com> Signed-off-by: Matt Turner <mattst88@gentoo.org> dev-ruby/ffi/ffi-1.15.5-r1.ebuild | 71 ++++++++++++++++++++++++++++++++ dev-ruby/ffi/files/backport-pr-962.patch | 48 +++++++++++++++++++++ dev-ruby/ffi/files/pr-957-sparc.patch | 42 +++++++++++++++++++ 3 files changed, 161 insertions(+) |