asdf-rust icon indicating copy to clipboard operation
asdf-rust copied to clipboard

Add exec-env to set CARGO_HOME properly

Open uvlad7 opened this issue 2 years ago • 3 comments

uvlad7 avatar Nov 07 '23 00:11 uvlad7

Should this also set CARGO_INSTALL_ROOT?

RobLoach avatar Sep 30 '24 19:09 RobLoach

to which version of rust you have installed

Yep, that's exactly why I've added this.

Should this also set CARGO_INSTALL_ROOT?

It works OK for me. I use this plugin in mise, and I have rustup version installed and linked into it'

vladimir@np940x5n:~/.local/share/mise$ mise list rust
Tool  Version           Config Source              Requested
rust  nightly                                               
rust  rustup (symlink)                                      
rust  1.72.1            ~/.config/mise/config.toml 1.72.1   
rust  1.73.0 (symlink)                                      
rust  1.77.1                                                
vladimir@np940x5n:~/.local/share/mise$ which evcxr
/home/vladimir/.local/share/mise/installs/rust/1.72.1/bin/evcxr
vladimir@np940x5n:~/.local/share/mise$ evcxr --version
evcxr_repl 0.16.0
vladimir@np940x5n:~/.local/share/mise$ mise shell rust@rustup
vladimir@np940x5n:~/.local/share/mise$ which evcxr
/home/vladimir/.local/share/mise/installs/rust/rustup/bin/evcxr
vladimir@np940x5n:~/.local/share/mise$ realpath $(which evcxr)
/home/vladimir/.cargo/bin/evcxr
vladimir@np940x5n:~/.local/share/mise$ evcxr --version
evcxr_repl 0.15.1

and it looks like CARGO_HOME is enough. CARGO_INSTALL_ROOT seems to be required only for separate bin dirs for the same rust version, or maybe a global installation, which, I believe, is not a default case.

uvlad7 avatar Sep 30 '24 20:09 uvlad7

:+1: Been using this change locally too.

@smorimoto Any chance to get this merged? If you don't have capacity, if you add me as a maintainer, I'd be happy to help out.

RobLoach avatar Sep 30 '24 21:09 RobLoach