-
Notifications
You must be signed in to change notification settings - Fork 830
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
bug: .tool-versions in home is not applied as global #1860
Comments
Hi @alvaroico , did you experience this issue on earlier versions of asdf? |
In versions prior to v0.16.0, the error does not occur. This happens because the system may not recognize the global version for directories located before the user's home (~/). In other words, programs installed in /opt, for example, may not detect the presence of Node.js or PHP. |
Hi there! I have the same kind of error when installing Ruby (which uses Rust to compile it's internal JIT) : building Rust YJIT (release mode)
No version is set for command rustc
Consider adding one of the following versions in your config file at /tmp/ruby-build.20250130213132.2471.si17Lg/ruby-3.4.1/.tool-versions
rust 1.83
make[1]: *** [yjit/yjit.mk:26: yjit/target/release/libyjit.a] Error 126 OS:
Linux cloud 6.1.0-30-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.124-1 (2025-01-12) x86_64 GNU/Linux
SHELL:
GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
BASH VERSION:
5.2.15(1)-release
ASDF VERSION:
v0.16.0
ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/data/nicolas/.asdf
ASDF_CONFIG_FILE=/data/nicolas/.asdfrc
ASDF INSTALLED PLUGINS:
bombardier https://github.com/NeoHsu/asdf-bombardier.git 46bea4d29d44a1578f7114bef0c86bfe9bbc3ee9
crystal https://github.com/asdf-community/asdf-crystal.git 7af37cf7b63ad0c3c176a1e740b2d0919f41f054
earthly https://github.com/YR-ZR0/asdf-earthly.git 58c78cb8b7b61e5b68f00714d0c8739f93cb5590
golang https://github.com/asdf-community/asdf-golang.git e2527a31714da7bc671a684308579f4ef8863281
k3d https://github.com/spencergilbert/asdf-k3d.git 5b0e5b9209bf0e1e8f83cbd912e8cccfe31e7fe2
kompose https://github.com/technikhil314/asdf-kompose.git 2706fa5579473c50aeb79c6098c7797ea96eb64c
kubectl https://github.com/asdf-community/asdf-kubectl.git 2fb3b57090e3efe55953a751a134c271ba83b119
mkcert https://github.com/salasrod/asdf-mkcert.git 8287d3c115b6c681592f44b2060973af6ae24be3
nodejs https://github.com/asdf-vm/asdf-nodejs.git 93bd217ba74f05080eebb7d8e1c146a385b01d7f
overmind https://github.com/virtualstaticvoid/asdf-overmind.git abaee0622091883c16f25cf860f19b0f3a2b639c
python https://github.com/danhper/asdf-python.git a3a01856098d6d2b9642e382f5b38e70275726d1
ruby https://github.com/asdf-vm/asdf-ruby.git 059cdee5b02c5a5569a5858e2a379f84dbdb95d7
rust https://github.com/code-lever/asdf-rust.git 95acf4fe65df1de74fca502482b8f3ac5af73c05
shellcheck https://github.com/luizm/asdf-shellcheck.git 66200ffa221fc75d7b28103f53326db6e721d08f
skaffold https://github.com/nklmilojevic/asdf-skaffold.git bf2f9922ddfc4d8613a2d92f3fedc458464e36e6
squarectl https://github.com/jbox-web/asdf-squarectl.git 5c0621cf4d1402c06cff70734c22a8c0f227198c
tokei https://github.com/gasuketsu/asdf-tokei.git d127410f0e4acf56b2e8070108df8a3847047fc6
yarn https://github.com/twuni/asdf-yarn.git 376c5407ef22c82fa56e4bd9f6a9108354063acb
yq https://github.com/sudermanjr/asdf-yq.git 772992f66c49fe681b1cd02d14e8166930472bf1 Rust 1.83 is declared globally : asdf list rust
*1.83 rustc --version
rustc 1.83.0 (90b35a623 2024-11-26) It was working well with asdf 0.15 |
Noticed the same with java and maven. Trying to find java on a new ubuntu installation.
Asdf info
P.S. This worked with the v0.15.0 |
So, i just tried to set/add the shims folder to my path and that fixed it.
|
Sorry forgot to add the tmp folder where i had another .tools-versions
|
I have the same problem, the Accepting the |
The issue arises when looking up .tool-versions in a mount point other than $HOME is mounted, causing it to fail when trying to detect global versions defined in $HOME/.tool-versions. Currently, when a drive is mounted (e.g., to /ssd) and a tool is used, ASDF looks for .tool-versions in the root of that filesystem. If no .tool-versions is found there, it fails. The expected behavior is for ASDF to fall back and check $HOME/.tool-versions in this scenario. |
I'm working on a fix for this now. It may take me a day or two to get merged, but once merged I'll be immediately releasing a patch version. |
* Use version in home dir when no version found in root dir * Correct `FindExecutable` function so returns `NoVersionSetError` even when `.tool-version` file located * Update `resolve` and `versions` package tests to use test plugin name Fixes #1860
I'm going to do some testing and then tag a patch release tonight with the fix for this. |
Describe the Bug
I had to apply .tool-versions to / and not to ~/ - "/home/user"
To fix this I copied .tool-versions from ~/ to /, making it the same as the global version
Steps to Reproduce
rodar algum comando em um nivel fora da home
cd ..
Expected Behaviour
Recognize ~/.tool-versions as the system-wide default
Actual Behaviour
is not logging in lower level folder outside ~/ so accepting commands inside /home/user
Environment
asdf plugins affected (if relevant)
The text was updated successfully, but these errors were encountered: