-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Allow place holders in build.target-dir #6210
Comments
This would be useful in my case, since I work in the same project on different architectures, and I need to have separate target-dir per system. I currently set the env variable I really miss solution for having a custom target-dir name relative to the root of the project, not the current working directory. |
Solved this for myself by putting this in my ~/.zshrc autoload -Uz add-zsh-hook
function cargo_target_chpwd {
local dir=$PWD:t # just the last path component of the project
export CARGO_TARGET_DIR=~/.cache/cargo-target/$dir
}
add-zsh-hook chpwd cargo_target_chpwd
cargo_target_chpwd # initial shell start Basically just resets the cargo target dir on every dir change. Same should be possible for other shells. Still would be better if this feature was integrated since the above doesn't work for rls in IDEs. |
I would like to configure
CARGO_TARGET_DIR
globally so that build happens on a faster/larger partition than${HOME}
(usually on NFS).Setting
in global
~/.cargo/config
causes bad effects because builds of different software packages are mixed in a single directory.It would be nice when
target-dir
accepts some place holders likewhere
%X
can be%C
... the hash of the directory withCargo.toml
%P
... the full path of the directory withCargo.toml
%N
... thepackage.name
(seems to be difficult with recent code)The text was updated successfully, but these errors were encountered: