Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

rust - Where does rustup install itself to?

I understand that rustup installs the rustc and cargo binaries to ~/.cargo/bin, but where does it install the rustup executable to? As far as I can tell this isn't explained in any documentation and running the installer doesn't tell you either. I'd like to avoid it being installed to anywhere except my home directory, if possible. I'm using macOS if that makes a difference.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

By default, rustup is also installed to your home directory:

$ which rustup
/Users/shep/.cargo/bin/rustup

The documentation states:

rustup installs rustc, cargo, rustup and other standard tools to Cargo's bin directory. On Unix it is located at $HOME/.cargo/bin and on Windows at %USERPROFILE%.cargoin. This is the same directory that cargo install will install Rust programs and Cargo plugins.

It goes on to describe how to change the defaults:

rustup allows you to customise your installation by setting the environment variables CARGO_HOME and RUSTUP_HOME before running the rustup-init executable. As mentioned in the Environment Variables section, RUSTUP_HOME sets the root rustup folder, which is used for storing installed toolchains and configuration options. CARGO_HOME contains cache files used by cargo.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...