-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The fiddle gem is broken on truffleruby and jruby #145
Comments
23 tasks
eregon
changed the title
The gem is broken on truffleruby and jruby
The fiddle gem is broken on truffleruby and jruby
Sep 16, 2024
kou
added a commit
that referenced
this issue
Sep 29, 2024
Fix GH-145 lib/fiddle/truffleruby.rb is based on https://github.com/oracle/truffleruby/blob/master/lib/truffle/truffle/fiddle_backend.rb . Here are changes for it: * Add `Fiddle::Types::VARIADIC` * Add `Fiddle::Types::CONST_STRING` * Add `Fiddle::Types::BOOL` * Add `Fiddle::ALIGN_BOOL` * Add `Fiddle::SIZEOF_BOOL` * Add `Fiddle::SIZEOF_CONST_STRING` * Add support for specifying type as not only `Fiddle::Types::*` but also `Symbol` like `:int` * Add `Fiddle::Error` as base the error class * Add support for `Fiddle::Pointer.malloc {}` `Fiddle::Pointer` * Add support for `Fiddle.free(#to_int)` * Accept `Fiddle::Function(need_gvl:)` but it's just ignored * `Fiddle::Function#initialize`: Add an argument validation * `Fiddle::Function#initialize`: Keep arguments as instance variables for getters * Add support for `Fiddle::Handle.sym` * Add support for `Fiddle::Handle.[]` * Add support for `Fiddle::Handle.sym_defined?` * Add support for `Fiddle::Handle#sym` * Add support for `Fiddle::Handle#[]` * Add support for `Fiddle::Handle#sym_defined?` * Add support for `Fiddle::Pointer.malloc` * Add support for `Fiddle::Pointer.to_ptr(#to_ptr)` * Add support for `Fiddle::Pointer#free=` * Add `Fiddle::Pointer#freed?` * Add support for `Fiddle::Pointer#call_free` * Add support for `Fiddle::Pointer#to_i` * Add support for `Fiddle::Pointer#to_int` * Add support for `Fiddle::Pointer#ptr` * Add support for `Fiddle::Pointer#+@` * Add support for `Fiddle::Pointer#ref` * Add support for `Fiddle::Pointer#-@` * Add support for `Fiddle::Pointer#null?` * Add support for `Fiddle::Pointer#to_s` * Add support for `Fiddle::Pointer#to_str` * Add support for `Fiddle::Pointer#inspect` * Add support for `Fiddle::Pointer#<=>` * Add support for `Fiddle::Pointer#==` * Add support for `Fiddle::Pointer#eql?` * Add support for `Fiddle::Pointer#+` * Add support for `Fiddle::Pointer#-` * Add support for `Fiddle::Pointer#[]=` * Add support for `Fiddle::Pointer#size` * Add support for `Fiddle::Pointer#size=` * Add `Fiddle::ClearedReferenceError` * Add no-op `Fiddle::Pinned` * Add `Fiddle::NULL` Some features are still "not implemented". So there are some "omit"s for TruffleRuby in tests.
kou
added a commit
that referenced
this issue
Oct 7, 2024
Fix GH-145 lib/fiddle/truffleruby.rb uses lib/fiddle/jruby.rb. lib/fiddle/jruby.rb uses FFI API. So we can use it for TruffleRuby too.
kou
added a commit
that referenced
this issue
Oct 7, 2024
Fix GH-145 lib/fiddle/truffleruby.rb uses lib/fiddle/jruby.rb. lib/fiddle/jruby.rb uses FFI API. So we can use it for TruffleRuby too.
eregon
pushed a commit
that referenced
this issue
Oct 8, 2024
Fix GH-145 lib/fiddle/truffleruby.rb is based on https://github.com/oracle/truffleruby/blob/master/lib/truffle/truffle/fiddle_backend.rb . Here are changes for it: * Add `Fiddle::Types::VARIADIC` * Add `Fiddle::Types::CONST_STRING` * Add `Fiddle::Types::BOOL` * Add `Fiddle::ALIGN_BOOL` * Add `Fiddle::SIZEOF_BOOL` * Add `Fiddle::SIZEOF_CONST_STRING` * Add support for specifying type as not only `Fiddle::Types::*` but also `Symbol` like `:int` * Add `Fiddle::Error` as base the error class * Add support for `Fiddle::Pointer.malloc {}` `Fiddle::Pointer` * Add support for `Fiddle.free(#to_int)` * Accept `Fiddle::Function(need_gvl:)` but it's just ignored * `Fiddle::Function#initialize`: Add an argument validation * `Fiddle::Function#initialize`: Keep arguments as instance variables for getters * Add support for `Fiddle::Handle.sym` * Add support for `Fiddle::Handle.[]` * Add support for `Fiddle::Handle.sym_defined?` * Add support for `Fiddle::Handle#sym` * Add support for `Fiddle::Handle#[]` * Add support for `Fiddle::Handle#sym_defined?` * Add support for `Fiddle::Pointer.malloc` * Add support for `Fiddle::Pointer.to_ptr(#to_ptr)` * Add support for `Fiddle::Pointer#free=` * Add `Fiddle::Pointer#freed?` * Add support for `Fiddle::Pointer#call_free` * Add support for `Fiddle::Pointer#to_i` * Add support for `Fiddle::Pointer#to_int` * Add support for `Fiddle::Pointer#ptr` * Add support for `Fiddle::Pointer#+@` * Add support for `Fiddle::Pointer#ref` * Add support for `Fiddle::Pointer#-@` * Add support for `Fiddle::Pointer#null?` * Add support for `Fiddle::Pointer#to_s` * Add support for `Fiddle::Pointer#to_str` * Add support for `Fiddle::Pointer#inspect` * Add support for `Fiddle::Pointer#<=>` * Add support for `Fiddle::Pointer#==` * Add support for `Fiddle::Pointer#eql?` * Add support for `Fiddle::Pointer#+` * Add support for `Fiddle::Pointer#-` * Add support for `Fiddle::Pointer#[]=` * Add support for `Fiddle::Pointer#size` * Add support for `Fiddle::Pointer#size=` * Add `Fiddle::ClearedReferenceError` * Add no-op `Fiddle::Pinned` * Add `Fiddle::NULL` Some features are still "not implemented". So there are some "omit"s for TruffleRuby in tests.
kou
added a commit
that referenced
this issue
Oct 10, 2024
Fix GH-145 Rename `lib/fiddle/jruby.rb` to `lib/fiddle/ffi_backend.rb` as a generic ffi gem API based implementation. JRuby and TruffleRuby use `lib/fiddle/ffi_backend.rb`. --------- Co-authored-by: Benoit Daloze <eregontp@gmail.com>
@kou Thank you for your help fixing this. |
Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given https://bugs.ruby-lang.org/issues/20309 fiddle will become a bundled gem in Ruby 3.5+.
As a result people will add fiddle to their Gemfile where they previously wouldn't (and so there was no issue).
Unfortunately this leads to failure for example on ffi/ffi#1119:
I think the best solution for now is to just use
fiddle
from stdlib on non-CRuby. That's properly tested and working.IOW, to not build or use the C extension on non-CRuby, similar to how it was done in ruby/stringio#71 or ruby/strscan#35
The text was updated successfully, but these errors were encountered: