Repository navigation
fiddle v1.1.3 and above breaks ffi head testsuite #159
Copy link
Copy link
Closed
Description
Using ruby 3.4.0dev (2024-11-07 master 048bb1e176) +PRISM [x86_64-linux]
ruby/ruby@048bb1e
Testing with ffi head ( ffi/ffi@c128ced ), test suite does not pass with fiddle v1.1.3, passes with v1.1.2; like
Failures:
1) Callback interop from ffi to fiddle
Failure/Error: func = LibTestFiddle.bind_function(:cbVrV, Fiddle::TYPE_VOID, [], &block)
TypeError:
wrong argument type Symbol (expected String)
# /builddir/build/GIT/fiddle/lib/fiddle/import.rb:319:in 'Fiddle::Function#initialize'
# /builddir/build/GIT/fiddle/lib/fiddle/import.rb:319:in 'Class#new'
# /builddir/build/GIT/fiddle/lib/fiddle/import.rb:319:in 'Fiddle::Importer#bind_function'
# ./spec/ffi/callback_spec.rb:912:in 'block (3 levels) in <module:CallbackInteropSpecs>'
# ./spec/ffi/callback_spec.rb:879:in 'RSpec::ExampleGroups::CallbackInterop#assert_callback_in_same_thread_called_once'
# ./spec/ffi/callback_spec.rb:911:in 'block (2 levels) in <module:CallbackInteropSpecs>'
2) Callback interop from ffi to fiddle with blocking:true
Failure/Error: func = LibTestFiddle.bind_function(:cbVrV, Fiddle::TYPE_VOID, [], &block)
TypeError:
wrong argument type Symbol (expected String)
# /builddir/build/GIT/fiddle/lib/fiddle/import.rb:319:in 'Fiddle::Function#initialize'
# /builddir/build/GIT/fiddle/lib/fiddle/import.rb:319:in 'Class#new'
# /builddir/build/GIT/fiddle/lib/fiddle/import.rb:319:in 'Fiddle::Importer#bind_function'
# ./spec/ffi/callback_spec.rb:920:in 'block (3 levels) in <module:CallbackInteropSpecs>'
# ./spec/ffi/callback_spec.rb:879:in 'RSpec::ExampleGroups::CallbackInterop#assert_callback_in_same_thread_called_once'
# ./spec/ffi/callback_spec.rb:919:in 'block (2 levels) in <module:CallbackInteropSpecs>'
3) Callback interop from fiddle to fiddle
Failure/Error: func = LibTestFiddle.bind_function(:cbVrV, Fiddle::TYPE_VOID, [], &block)
TypeError:
wrong argument type Symbol (expected String)
# /builddir/build/GIT/fiddle/lib/fiddle/import.rb:319:in 'Fiddle::Function#initialize'
# /builddir/build/GIT/fiddle/lib/fiddle/import.rb:319:in 'Class#new'
# /builddir/build/GIT/fiddle/lib/fiddle/import.rb:319:in 'Fiddle::Importer#bind_function'
# ./spec/ffi/callback_spec.rb:928:in 'block (3 levels) in <module:CallbackInteropSpecs>'
# ./spec/ffi/callback_spec.rb:879:in 'RSpec::ExampleGroups::CallbackInterop#assert_callback_in_same_thread_called_once'
# ./spec/ffi/callback_spec.rb:927:in 'block (2 levels) in <module:CallbackInteropSpecs>'
Finished in 3.88 seconds (files took 1.04 seconds to load)
5015 examples, 3 failures
Failed examples:
rspec ./spec/ffi/callback_spec.rb:909 # Callback interop from ffi to fiddle
rspec ./spec/ffi/callback_spec.rb:917 # Callback interop from ffi to fiddle with blocking:true
rspec ./spec/ffi/callback_spec.rb:925 # Callback interop from fiddle to fiddle
git bisect shows 91d0ea9 is the bad commit.
For now, reporting to fiddle side.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
kou commentedon Nov 9, 2024
Thanks for your report.
The bad commit you identified introduced a limitation that "Function name must be String" limitation.
I've removed the limitation. The ffi gem tests worked again.
I'll release a new version. It'll be included in Ruby 3.4.0.
[ruby/fiddle] Accept Symbol as Function name again
Accept Symbol as Function name again