Uh oh!
There was an error while loading. Please reload this page.
Conversation
Fig GH-104 lib/fiddle/jruby.rb is based on https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/fiddle/jruby.rb . Here are changes for it: * Move `Fiddle::TYPE_*` to `Fiddle::Types::*` * Add `Fiddle::Types::VARIADIC` * Add `Fiddle::Types::CONST_STRING` * Add `Fiddle::Types::BOOL` * Add `Fiddle::Types::INT8_T` * Add `Fiddle::Types::UINT8_T` * Add `Fiddle::Types::INT16_T` * Add `Fiddle::Types::UINT16_T` * Add `Fiddle::Types::INT32_T` * Add `Fiddle::Types::UINT32_T` * Add `Fiddle::Types::INT64_T` * Add `Fiddle::Types::UINT64_T` * Add more `Fiddle::ALIGN_*` for the above new `Fiddle::Types::*` * Add more `Fiddle::SIZEOF_*` for the above new `Fiddle::Types::*` * Add support for specifying type as not only `Fiddle::Types::*` but also `Symbol` like `:int` * Add support for variable size arguments in `Fiddle::Function` * Add `Fiddle::Closure#free` * Add `Fiddle::Closure#freed?` * Add `Fiddle::Error` as base the error class * Add `Fiddle::Pointer#call_free` and stop using `FFI::AutoPointer` in `Fiddle::Pointer` * Add support for `Fiddle::Pointer.malloc {}` `Fiddle::Pointer` * Add support for `Fiddle::Pointer#free=` * Add `Fiddle::Pointer#freed?` * Use binary string not C string for `Fiddle::Pointer#[]` * Add `Fiddle::Handle.sym_defined?` * Add `Fiddle::Handle#sym_defined?` * Add `Fiddle::Handle::DEFAULT` * Add `Fiddle::ClearedReferenceError` * Add no-op `Fiddle::Pinned` Some features are still "not implemented". So there are some "omit"s for JRuby in tests.
| def test_set_ctypes | ||
| if RUBY_ENGINE == "jruby" and Fiddle::WINDOWS | ||
| omit("JRuby's 'l!' pack string is buggy. " + | ||
| "See https://github.com/jruby/jruby/issues/8357 for details") |
There was a problem hiding this comment.
I will look into it but the workaround is probably going to need to be in place for a while.
There was a problem hiding this comment.
@kou yeah for a while likely means JRuby 10 will fix this but 9.4 will continue to use that behavior since it would break any saved pack data for a JRuby app on windows.
There was a problem hiding this comment.
OK. I've added a workaround for JRuby 9.4 on Windows: b809583
eregon
commented
Oct 1, 2024
Taking a quick look at this, since it is implementing Fiddle using FFI that should work on TruffleRuby too, since both JRuby and TruffleRuby ship |
headius
commented
Oct 1, 2024
It would be helpful to all involved if we could share a single pure-Ruby implementation for this gem that works across all implementations.
Fiddle uses FFI internally. Any overhead introduced by using FFI from Ruby to implement Fiddle can be mitigated along the way, using more direct FFI APIs or by improvements to FFI itself. |
kou
commented
Oct 1, 2024
@headius@enebo Can we relicense |
headius
commented
Oct 2, 2024
I will look into this. |
headius
commented
Oct 2, 2024
Regarding code from https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/fiddle.rb and https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/fiddle being imported into this repository, I consent to relicense my contributions under the terms of the Ruby license and the BSD-2-Clause license. |
headius
commented
Oct 2, 2024
@enebo@ahorek@ikaronen-relex You have change lines in the imported versions of these files. Could you reply here giving your consent to relicense the code for Ruby and BSD-2-Clause as I did above? |
ikaronen-relex
commented
Oct 2, 2024
@headius As far as I can tell, all I've contributed to this PR is an empty line, which is not copyrightable. But just in case I've missed something else (and for the avoidance of doubt), I hereby consent to relicense all my past and future contributions to JRuby (and specifically those included in this PR) under the terms of the Ruby license and the BSD-2-Clause license. |
headius
commented
Oct 2, 2024
@ikaronen-relex Ok, I just looked at the history. If you had other lines they may have been overwritten over time. Thanks for the consent in any case! |
ahorek
commented
Oct 3, 2024
sure! I consent to relicense my contributions under the terms of the Ruby license and the BSD-2-Clause license. |
enebo
commented
Oct 3, 2024
I also consent to relicense my contributions under the terms of the Ruby license and the BSD-2-Clause license. |
headius
commented
Oct 6, 2024
@kou Everyone with lines in these source files has consented to relicense. I think we are good to go there! |
kou
commented
Oct 7, 2024
Thanks! |
headius
commented
Oct 10, 2024
@kou Thank you for the extra work to import JRuby's FFI fiddle! 🙇♂️ |
FixGH-104
lib/fiddle/jruby.rb is based on
https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/fiddle/jruby.rb .
Here are changes for it:
Fiddle::TYPE_*toFiddle::Types::*Fiddle::Types::VARIADICFiddle::Types::CONST_STRINGFiddle::Types::BOOLFiddle::Types::INT8_TFiddle::Types::UINT8_TFiddle::Types::INT16_TFiddle::Types::UINT16_TFiddle::Types::INT32_TFiddle::Types::UINT32_TFiddle::Types::INT64_TFiddle::Types::UINT64_TFiddle::ALIGN_*for the above newFiddle::Types::*Fiddle::SIZEOF_*for the above newFiddle::Types::*Fiddle::Types::*but alsoSymbollike:intFiddle::FunctionFiddle::Closure#freeFiddle::Closure#freed?Fiddle::Erroras base the error classFiddle::Pointer#call_freeand stop usingFFI::AutoPointerinFiddle::PointerFiddle::Pointer.malloc {}Fiddle::PointerFiddle::Pointer#free=Fiddle::Pointer#freed?Fiddle::Pointer#[]Fiddle::Handle.sym_defined?Fiddle::Handle#sym_defined?Fiddle::Handle::DEFAULTFiddle::ClearedReferenceErrorFiddle::PinnedSome features are still "not implemented". So there are some "omit"s for JRuby in tests.