Avoid loading jar-dependencies to install gem hook#8502
Merged
headius merged 1 commit intojruby:masterfrom Dec 10, 2024
Merged
Conversation
By requiring a file from jar-dependencies here, we end up activating whatever the default jar-dependencies gem is for the current JRuby runtime. Later on, when the hook is running or gems that use jars simply try to activate a newer jar-dependencies, we get the dreaded version conflict described in jruby/jar-dependencies#86, preventing activation of all libraries. The change here moves the body of the hook into the JRuby defaults.rb for RubyGems rather than loading any files from jar-dependencies itself. This appears to fix issues like those seen in the jruby-9.4.9.0 builds at ruby/rdoc#1229 (bundle exec failing to run due to the version conflict) and may fix other reports. This does not fix issues using a newer jar-dependencies on an older JRuby, unfortunately.
This was referenced Dec 10, 2024
headius
added a commit
to headius/ruby-maven
that referenced
this pull request
Dec 10, 2024
Somehow this crept back in after jruby/jruby#8502
This was referenced Dec 10, 2024
This was
linked to
issues
Dec 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By requiring a file from jar-dependencies here, we end up activating whatever the default jar-dependencies gem is for the current JRuby runtime. Later on, when the hook is running or gems that use jars simply try to activate a newer jar-dependencies, we get the dreaded version conflict described in
jruby/jar-dependencies#86, preventing activation of all libraries.
The change here moves the body of the hook into the JRuby defaults.rb for RubyGems rather than loading any files from jar-dependencies itself. This appears to fix issues like those seen in the jruby-9.4.9.0 builds at ruby/rdoc#1229 (bundle exec failing to run due to the version conflict) and may fix other reports.
This PR does not yet fix issues using a newer jar-dependencies on an older JRuby, unfortunately, but it will fix at least part of the problem for JRuby releases 9.4.10.0 and higher.