Closed apoorv569 closed 1 year ago
Hi,
Same here, I set it to a custom location too. Do you find the solution?
Previously, I use Doom, and it works out of the box after running doom env
https://github.com/rust-lang/rust-mode/issues/450#issuecomment-1172443787
UPDATE:
I need to set this https://github.com/joaotavora/eglot/discussions/1249#discussioncomment-6278374
Hi,
Same here, I set it to a custom location too. Do you find the solution?
Previously, I use Doom, and it works out of the box after running
doom env
#450 (comment)UPDATE:
I need to set this joaotavora/eglot#1249 (reply in thread)
Yes, it turns out exec-path-from-shell
by default doesn't read all env variables. I added all my other env variables manually like this,
(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 getenv
and setenv
instead of this package if you want.
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.