-
Notifications
You must be signed in to change notification settings - Fork 181
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
cargo check and cargo metadata not respecting CARGO_HOME env variable. #464
Comments
Hi, Same here, I set it to a custom location too. Previously, I use Doom, and it works out of the box after running UPDATE: I need to set this joaotavora/eglot#1249 (reply in thread) |
Yes, it turns out (use-package exec-path-from-shell
:straight t
:custom
;; (exec-path-from-shell-shell-name "/bin/zsh")
(exec-path-from-shell-variables '("PATH"
"MANPATH"
"XDG_DATA_HOME"
"XDG_CACHE_HOME"
"XDG_CONFIG_HOME"
"XDG_STATE_HOME"
"CARGO_HOME"
"RUSTUP_HOME"
"ANDROID_HOME"
"DOOMDIR"
"EMACSDIR"
"XINITRC"
"XSERVERRC"
"XAUTHORITY"
"USERXSESSION"
"USERXSESSIONRC"
"ALTUSERXSESSION"
"INPUTRC"
"ERRFILE"
"GNUPGHOME"
"_JAVA_OPTIONS"
"GTK2_RC_FILES"
"ZDOTDIR"
"HISTFILE"
"CARGO_HOME"
"RUSTUP_HOME"
"GOPATH"
"RIPGREP_CONFIG_PATH"
"XMONAD_CONFIG_HOME"
"XMONAD_DATA_HOME"
"XMONAD_CACHE_HOME"
"WGETRC"
"PASSWORD_STORE_DIR"
"WINEPREFIX"
"GEM_SPEC_CACHE"
"VAGRANT_HOME"
"XCURSOR_PATH"
"STARSHIP_CONFIG"
"STARSHIP_CACHE")))
(when (memq window-system '(mac ns x))
(exec-path-from-shell-initialize)) You can also just use |
I have my
CARGO_HOME
andRUSTUP_HOME
set to~/.loca/share/cargo
and~/.local/share/rustup
respectively, all commands do find the correct binary and run the correct command, but each time I make a change to myrust
source file orCargo.toml
filecargo check
orcargo metadata
fires up automatically using the defaultcargo
directory which is~/.cargo
and keeps re-compiling my program which takes some time and as it is needed to get linting and all I can't skip it.I tried editing several variables to fix the issue but nothing seems to help,
I added all those variables under the
custom
section, but nothing helps.I had the problem with other commands not finding the binary path correctly at first, but I fixed that by installing,
If I delete the
~/.cargo
directory I get error,and after few seconds it starts again, creating the
~/.cargo
directory and re-compiling my program.The text was updated successfully, but these errors were encountered: