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.
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
asdf: install into libexec and bin.write_exec_script to opt_libexec/bin/asdf #73173
asdf: install into libexec and bin.write_exec_script to opt_libexec/bin/asdf #73173
Changes from 16 commits
5014a0e
4b6418a
b517eb0
731290a
5b99c71
bc44890
9435946
aae56ab
6b9f33b
7ec5a42
b67ca06
9290bfb
6baf058
0d8ddaf
51e2e38
10aca50
198430f
c6dbcad
c243d9f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Another optional change mainly for documentation/migration.
May require further editing depending on recommendations from Homebrew maintainers on best way to present caveats and depending on decision for the previous optional change.
Caveat text based on autojump.rb and chruby.rb
For users who just want all of asdf working after install, I think this is the best option.
Since asdf documentation recommends sourcing this for all users (Linux/macOS and git/homebrew), I think this should be default recommendation.
For users who want to do the minimal changes like only exporting shim paths, I think this should be left up to the users to understand how asdf.sh works and apply the correct exports themselves. This avoids asdf issues created due to doing something not documented.
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.
@cho-m
Again, wouldn't that modify your
$PATH
and also add the asdf binary again which should already be there?In my opinion both
asdf.fish
andasdf.sh
should be ignored by Homebrew users and they should go straight to the actual files(using
.
instead ofsource
)That way
$ asdf shell
works and no one messes with your$PATH
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.
@seivan
The goal is low-impact migration and low-impact maintenance.
In order to get the same behavior as before, Homebrew users would have to do at least an
export
(shim path) +source
(shell function). Neither of these steps are currently documented by ASDF.There is also the potential impact of missing
export ASDF_DIR
. Some plugins like asdf-nodejs directly use this variable. If missing this causes any breakage, then Homebrew users would have to now do 2export
+ 1source
for feature parity.Additionally, if ASDF does a change to their shell scripts, Homebrew users should not start raising ASDF issues due to following a set of instructions that were not directly recommended by ASDF. If a user wants to clean up their environment variables / PATH, they should do so with full understanding that this is not directly supported yet and any problems they encounter may be due to their own changes.
I personally think it is better to perform a migration in small stages:
$ASDF_DIR/bin
to path for Homebrew users${ASDF_DATA_DIR:-$HOME/.asdf}/shims
to PATH for base featureslib/asdf.sh
for shell feature.(prefix/"asdf.sh")
. Since we are really only doing a patch update (0.8.0_1 -> 0.8.0_2), it is best to have no noticeable impact.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.
@cho-m
I am with you in trying to make as little manual intervention as possible for migrating, but not at the cost of fixing the issue now or messing things up further to prolong the fix.
As I've stated earlier, as long as
$ asdf
and$ asdf help
is broken on install everything else is moot.The current setup is already broken and requires manual intervention.
Current users has most likely "mitigated" that and will require manual intervention on upgrade, there is no way around these two things.
It's better to fix it now than to prolong it and your steps are flawed, I'll go through each manually.
Incorrect on two parts.
If someone has customized the
ASDF_DATA_DIR
they have also exported that variable whichasdf_data_dir()
function reads and it will work as intended.If they have not, it will default to
$HOME/.asdf
and it will work as intended.That nodejs plugin is confusing
$ASD_DIR
with$ASDF_DATA_DIR
.I have not, and it worked as intended.
What changes are these?
In general, I agree with you previous statement about the caveat, you just got the paths wrong
If they need
asdf shell
then explain to them that they should sourceand to add executables to their
$PATH
the need to set this in their.profile
or.zshenv
That should be the caveat, that's a complete setup for bash/zsh, and something different for Fish I'd presume.
Hard disagree in this case, as the setup is broken. Any other case, I'd agree with you.
Depends on what update, and if the caveat refers to something that will be inadequate in the future.
Then you're just prolonging it
Yeah, again, hard disagree.
You should do this now, because you're just prolonging the issues and the mess continues.
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.
@cho-m
If it was unclear:
I think your code suggestions are solid for making it work for existing users migrating - assuming you have tested an existing setup with these added later.
I just disagree with the caveats, that's all. They should not explain the "old" approach.
Correct me if I am wrong, but with your changes suggested:
Are both points correct?
That being said, I am surprised that existing shims would work.
My shims are written as
I don't think adding
Will fix that, it just makes existing settings that source that file to still work, which is fine on its own, but doesn't serve a purpose if a user has to reshim. If they're doing that manual intervention, might as will do a full on migration.
Again, I could be wrong, if you could confirm that with those changes added your shim paths to old executable would still work, then it's game.
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.
@cho-m
Maybe, however I don't agree but then again these are more opinions than facts. Let me make my case, and if you still dislike it, I'll revert.
First off, I don't want stuff added to my
$PATH
, I know macOS does this, but that's the OS, it gets a pass.I think it's better for
asdf
has this in their documentation as this is where you're adding all the compilers, interpreters and other binaries, it's more explicit in what's going on.For this reason, I think exporting shims in path should be very explicit.
Then there is the issue with a specific feature of asdf that requires sourcing. I see this as a separate thing and not related to exporting shims to
$PATH
What I'm more indifferent about is if the caveat should be explicit about why you're sourcing a file.
I've added this
So the choices for caveats as I see is
@cho-m So, how do you feel about option 3?
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.
I think this question should be redirected to Homebrew maintainers (who may have explicit rules on what is allowed in caveats) and ASDF maintainers (who may have opinions on recommended installation steps).
I am neither, so I want to avoid suggesting something that doesn't line up with both projects' ideology.
Hopefully one of the Homebrew members already subscribed to this PR can respond.
They should know better on how the general user-base deals with caveat info.
I see you also have discussion on ASDF asdf-vm/asdf#891 so maybe see if there are any opinions are on that side. The decision here may require changes for ASDF's own documentation.
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.
@cho-m Fair enough, both @carlocab and @jthegedus wanna chime in here?
Edit: Added suggestions on how to change docs in asdf-vm/asdf#898
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.
@carlocab
What is your take on the current caveats.
@cho-m Showed that chruby and autojump had support for sourcing files.
I also saw openssl explaining how to add to $PATH.