是否可以有多个并存的Rust安装? [英] Is it possible to have multiple coexisting Rust installations?

查看:139
本文介绍了是否可以有多个并存的Rust安装?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能为了方便(每晚构建周期,自动更新)而每晚构建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

或通过

如果您只想暂时使用其他工具链,则可以使用"plus语法":

If you want to just use a different toolchain temporarily, you can use the "plus syntax":

rustc +1.7 --help
cargo +nightly build

在其他情况下,您可以使用rustup run在特定工具链中运行任意命令:

In other cases you can use rustup run to run any arbitrary command in a specific toolchain:

rustup run nightly any command you want here 

另请参阅:

这篇关于是否可以有多个并存的Rust安装?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆