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.
By default, rustup is also installed to your home directory:
$ which rustup
/Users/shep/.cargo/bin/rustup
The documentation states:
rustupinstallsrustc,cargo,rustupand other standard tools to Cargo'sbindirectory. On Unix it is located at$HOME/.cargo/binand on Windows at%USERPROFILE%\.cargo\bin. This is the same directory thatcargo installwill install Rust programs and Cargo plugins.
It goes on to describe how to change the defaults:
rustupallows you to customise your installation by setting the environment variablesCARGO_HOMEandRUSTUP_HOMEbefore running the rustup-init executable. As mentioned in the Environment Variables section,RUSTUP_HOMEsets the root rustup folder, which is used for storing installed toolchains and configuration options.CARGO_HOMEcontains cache files used by cargo.
In my case rustup (along with it's installed toolchains) is in a folder named .rustup which is on the same level as .cargo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With