Fix definition lookup for ruby-prefixed names like ruby-dev#2621
Merged
Conversation
`resolve_version` strips the leading `ruby-` from its argument and then only looks for the stripped form in the definitions directory. For canonical definitions whose filename retains the `ruby-` prefix (currently `ruby-dev`) the exact-match step searches for `dev`, which does not exist, and the grep fallback's `^dev[-.]` anchor also misses the `ruby-dev` line in the definitions list. Result: `ruby-build ruby-dev` reports "definition not found" even though the file is shipped. Try the original (unstripped) argument first in the exact-match loop, then fall back to the stripped form. Numeric-version inputs (`ruby-3.4.9`, `3.4`, `ruby-3.4`) and other implementations (`mruby-dev`, `jruby-dev`) are unaffected because their existing code paths still match. Regression introduced in rbenv#2610.
Member
|
@mislav I'll merge this now since this is a low-risk bug fix and it fixes a significant released breaking change. |
Member
Member
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.
Currently,
rbenv install ruby-devfails as follows since 92d57fd introduced via #2610.This patch fixes this regression by trying the exact match first, then falling back to the partial match intruduced via #2610.