-
Notifications
You must be signed in to change notification settings - Fork 786
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
Installation with Homebrew isn't complete. #891
Comments
Install a libexec under bin to maintain relative paths for sourcing scripts. This will target `bin/asdf` that will source other shell scripts, like `source "$(dirname "$(dirname "$0")")/lib/utils.bash"` Probably need approval and eyes from maintainer(s) Fix: asdf-vm/asdf#891
I added a fix to the Homebrew formula Homebrew/homebrew-core#73173 The only concern here is that If anyone wants a different directory for |
I have left some questions about the migration path in the Homebrew issue. I would really like this change to succeed if it means no more issues being raised about Homebrew install not working. But I am concerned how this change would impact all Homebrew users with the current configuraitons.
Out of curiosity, why is it you think having users understand their Shell configuration is a bad thing? Especially for a tool that configures Shell behaviour? OMZSH is an entire ecosystem of plugins managed via your Shell config, why is it bad?
I don't know the answer to that, @Stratus3D probably does. |
The manual user intervention is not necessary to make Obviously majority use would like to add them to If the shims where, say under It's not just the manual intervention I have issues with, it's the fact that the script itself requires to be sourced because of a poor installation process that not only requires you to source a file at an arbitrary location that modifies your Homebrew mentions this:
Thank you, I'll be taking a look. |
There are two changes that are going to happen. So my current shims are at !/usr/bin/env bash
# asdf-plugin: elixir 1.11.3
exec /usr/local/Cellar/asdf/0.8.0_1/libexec/bin/asdf exec "iex" "$@" But they need to point to !/usr/bin/env bash
# asdf-plugin: elixir 1.11.3
exec /usr/local/Cellar/asdf/0.8.0_2/libexec/bin/asdf exec "iex" "$@" So you need to do an Secondly, if you sourced
That's not what I am saying. I am saying that it's wrong of Keep in mind that ``"$(brew --prefix asdf)/` actually runs ruby which slows down your shell. brew --prefix asdf --debug
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::FormulaLoader): loading /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/asdf.rb
/usr/local/Homebrew/Library/Homebrew/brew.rb (Formulary::TapLoader): loading /usr/local/Homebrew/Library/Taps/seivan/homebrew-custom/Formula/asdf.rb If I am installing a program, I expect it to work out of the box if its under my It's not to say you don't need to configure your shell, you obviously do, but just for your package manager, anything else should work.
It seems to me, and I could be wrong that it just modifies |
@jthegedus Just to keep you updated, the current PR no longer has a need for a migration step with current setup. Changes
MigrationExisting solutions will work fine But you can also do CaveatThe caveat currently pending review mentions the "newer" approach def caveats
<<~EOS
Add shims in $PATH by having the following line your ~/.zshenv or #{shell_profile}:
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
To support package version per session using asdf shell <name> <version>
Add the following line to your #{shell_profile} file:
. #{opt_libexec}/lib/asdf.sh
Restart your terminal for the settings to take effect.
EOS
end |
The installation instructions say "Add asdf.sh to your ~/.zshrc with...". However, the Homebrew post-installation message for asdf doesn't mention this. I see there is a PR here to change the Homebrew asdf formula. Perhaps, if the PR is still under discussion, the Homebrew post-installation message can be changed in the meantime to instruct the user to update the .zshrc (or equivalent bash or fish) file. Note that adding asdf to the shell configuration is necessary for Apple Silicon (where Homebrew installs packages to |
I appreciate that others think this is a good idea, unfortunately I have pursued that idea without any luck on the Homebrew side. |
@jthegedus May I see the PR or issue you submitted to Homebrew? I wonder if anything has changed since Apple released M1 and Homebrew is moving to use its own |
@DanielKehoe This current issue is tracking the work to be done to resolve the suggestion that came out of the conversation after the one you're asking for... there's a lot of prior conversation on this.
Note the conversaton in #785 as some of it is from a Homebrew contributor. I cannot speak for Intel vs Apple Silicon differences. I have yet to get to reviewing the work the OP has done to rectify the initial issues. |
Thank you for the helpful reply. I understand the obstacle now. I see a Homebrew maintainer said, "Anything that is definable in documentation is not supposed to be in caveats. Those are only for homebrew specific quirks or issues." I've updated my guide Install Asdf Version Manager for Ruby users that will provide the details in case users don't check the asdf documentation. Thanks for all your efforts on development and maintenance! It's a great project but I'm sure it can be frustrating at times :-) |
@seivan I still intend to look at your improvements for Homebrew |
Sorry for the late response here, but to answer a question from a while back in this thread:
Yes, the reason that code can't live in |
As an update, there's an alternate Homebrew |
Getting same issue after brew upgrade:
|
I think Homebrew/homebrew-core#81664 is ready to merge, but I'd appreciate more feedback from I don't think there should be any breaking changes, but the asdf docs could probably be updated. |
Thanks to @seivan, I was able to get things to work again. Here are the steps it took in case anyone else finds it useful. I used brew to update asdf from After that, I was getting a lot of errors mentioning files not existing in |
Describe the bug
Installing asdf with homebrew should work out of the box, assuming
$PATH
is properly set up to find theasdf
binary.To Reproduce
Steps to reproduce the behavior:
brew install asdf
Expected behavior
It should work.
Actual behavior
It's incomplete and doesn't work.
Throws an error
Instead, to work around it, you also have to source
/usr/local/opt/asdf/asdf.sh
which modifies for shims and the asdf executable (again).In general,
$ asdf help
and other commands don't work until that's been setup, which is bad.There are other issues, such as polluting
/usr/local/lib
and other directories since it's a straight upprefix.install
with a glob, something Homebrew advices against.Related PR(s):
Code
Homebrew/homebrew-core#73173
Documentation
#898
Related
#785
#607
#394
#428
The text was updated successfully, but these errors were encountered: