Use expand_path logic for Dir.glob base path#6084
Merged
headius merged 2 commits intojruby:masterfrom Feb 19, 2020
Merged
Conversation
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
This reverts commit e22bb98.
This was referenced Feb 19, 2020
enebo
approved these changes
Feb 19, 2020
Member
enebo
left a comment
There was a problem hiding this comment.
We may have something which uses fsenc for 9.3 but this looks like less of a semantic gamble for 9.2.11.0
headius
added a commit
that referenced
this pull request
Feb 19, 2020
Use expand_path logic for Dir.glob base path
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.
This should fix issues reported with RubyGems 3.0.6 and jarred resources.
Fixes #6060
Fixes #6082
Fixes #6083
I have reverted the tests we disabled in 9.2.10.0 but a more direct test of this behavior (i.e. passing a
base:URI to Dir.glob) would be useful to make sure we don't regress.