是否可以有多个并存的Rust安装? [英] Is it possible to have multiple coexisting Rust installations?
问题描述
是否有可能为了方便(每晚构建周期,自动更新)而每晚构建Rust编译器以及出于实验目的从GitHub克隆的Rust开发版本?
Would it be possible to have a nightly build Rust compiler for convenience (faster build cycle, auto-update) and a dev version of Rust cloned from GitHub for experimentation purposes?
这个想法是,我有一个用于我的各种项目的Rust二进制版本和一个我可以破解的Rust版本,而不会引起彼此之间的破坏.
The idea is I have a binary version of Rust for my various project and a version of Rust I can hack on, without them causing havoc between each other.
如果有关系,请假设我的操作系统是Ubuntu 64位.
If it matters, assume my OS is Ubuntu 64-bit.
推荐答案
当前的解决方案是使用 rustup .安装后,您可以安装多个工具链:
The current solution is to use rustup. Once installed, you can install multiple toolchains:
rustup install nightly
rustup install stable
rustup install 1.7
如果您具有Rust的本地版本,则可以链接作为工具链
If you have a local build of Rust, you can link it as a toolchain
rustup toolchain link my-development /path/to/rust/code
您可以选择一个默认工具链
rustup default stable
或仅通过rustup
cd /my/cool/project
rustup override set nightly