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
Check JRuby version without accessing Gem #823
Conversation
The TruffleRuby code might want to do the same. |
The two specific failure cases I see in JRuby CI:
The latter usage could possibly delay booting FFI, but either way once it's needed it needs to be loadable without RubyGems present. |
In TruffleRuby I did not hit this issue because Making FFI a default gem sounds nice. |
When running with --disable-gems, we still need to be able to load FFI from stdlib. Accessing the Gem namespace here requires that gems not be disabled. This patch splits and compares the integer elements of version directly rather than using Gem::Version to do that comparison. See ffi#763 for the original code.
6f33774
to
b0f9d16
Compare
Patch has been updated to use a more terse version and remove remaining references to Gem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@larskanis Could you merge? (maybe @headius needs a release too?)
Once there's a release with these changes I can flip the switch to make ffi a default gem in JRuby and delete our copies of the ruby files. |
When running with --disable-gems, JRuby still needs to be able to load FFI from stdlib. Accessing the Gem namespace here requires that gems not be disabled.
This patch uses a simple split and integer comparison to compare the first two digits of the JRuby version with 9.3.
See #763 for the original code.
This patch is necessary for JRuby to fully source the FFI Ruby files from the gem (jruby/jruby#6150). Example failures here are due to the MRI suites running without RubyGems enabled, but they end up needing FFI for internal JRuby functionality.
https://travis-ci.org/github/jruby/jruby/builds/729197020
So close!