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
Globbed jar contents with expand path failing in RubyGems #6060
Milestone
Comments
headius
added a commit
to headius/jruby
that referenced
this issue
Feb 14, 2020
This was referenced Feb 19, 2020
headius
added a commit
to headius/jruby
that referenced
this issue
Feb 19, 2020
Dir.glob was treating any passed-in `base` path as a normal file path, which cause it to treat URIs as a relative path. The logic then proceeded to prepend the cwd to this URI, producing a nonsense path. This patch uses File.expand_path logic to acquire the base path, which keeps it a URI and allows the rest of glob to handle it as if the glob and base were expanded before calling Dir.glob. The change means that the two following Dir.glob calls work the same, fixing the issues discovered in jruby#6060. It will very likely also fix the issues reported in jruby#6082 and jruby#6083. Fixes jruby#6060 Fixes jruby#6082 Fixes jruby#6083
headius
added a commit
to headius/jruby
that referenced
this issue
Feb 19, 2020
This reverts commit e22bb98.
headius
added a commit
to headius/jruby
that referenced
this issue
Feb 19, 2020
This relates to the changes in jruby#6060. We could think of no valid reason for File.expand_path not to return strings encoded the same as system file paths are encoded, but it's not clear if this semantic change would cause any incompatibility.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
headius commentedFeb 14, 2020
In #5996 we discovered that a RubyGems update seems to break our ability to use a jar file as a GEM_PATH.
The failures look like this:
These failures are due to a change in rubygems/rubygems@28c1f22 that modifies how gem paths are globbed to find gems and gemspecs.
The failure happens when doing one of two things and then trying to load a jarred gem:
In each case, the "2.5" section in util.rb is the cause, and disabling that branch makes the jarred gem work correctly again.
A reduced script demonstrating the problem outside of RubyGems is here (using the
test/jruby/gem.jar
file in our repository:The first glob is the one that fails, producing an empty array.
The text was updated successfully, but these errors were encountered: