-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
rbenv: use opt bin symlink in rehash script #75996
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
This works, but it feels brittle. If the expression
command -v rbenv
changes even slightly within rbenv source, this workaround silently breaks.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.
There are two potential sources of breakage:
$(command -v rbenv)
.libexec/rbenv-rehash
starts using$(command -v rbenv)
somewhere else we may not want to change.Both seem sufficiently unlikely to me, but you'd know more about this than I do, of course.
libexec/rbenv-rehash
hasn't changed in years, and the relevant line we want to change has been there for even longer.I'm not sure 2 is such a problem either, as I think I'm comfortable with using
opt_bin/"rbenv"
everywhererbenv
wants to docommand -v rbenv
.1 should not be a problem as long as it doesn't happen simultaneously with 2, as the
inreplace
will error out when it is unable to do a replacement. We can avoid that by tightening theinreplace
with more context from the line we actually want to replace.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.
Thanks for elaborating. I'm not opposed to this being merged. But I do not feel like the fix is ideal in the long term. The main problem is that Homebrew aggressively prunes old versions of software after upgrades. This breaks not just rbenv, but also ruby gems linked to removed versions of Homebrew software that got updated in the meantime. I have fixed my own Ruby development environment with
export HOMEBREW_NO_INSTALL_CLEANUP=true
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.
Hopefully such a change wouldn't break silently and would be picked up by the test.