Where does rustup install itself to?

前端 未结 1 1909
长发绾君心
长发绾君心 2021-01-12 07:37

I understand that rustup installs the rustc and cargo binaries to ~/.cargo/bin, but where does it install the rustu

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-12 08:10

    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%\.cargo\bin. 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.

    0 讨论(0)
提交回复
热议问题