[英]Rustup vs Cargo binaries
I just installed Rustup on macOS and noticed that there are two rustc
and two cargo
binaries: 我刚刚在macOS上安装了Rustup,并注意到有两个rustc
和两个cargo
Binaries:
~/.cargo/bin/rustc (cargo)
~/.rustup/toolchains/stable-x86_64-apple-darwin/bin/rustc (cargo)
Their versions are exactly the same, but diff
shows there exists some difference. 它们的版本完全相同,但是diff
显示存在一些差异。 So why are there two different rustc
( cargo
) binaries and which one should I use? 那么,为什么会有两种不同的rustc
( cargo
)二进制文件,我应该使用哪一种呢?
The reason there are two files named rustc
is because rustup is a toolchain multiplexer. 之所以有两个名为rustc
文件,是因为rustup是一个工具链多路复用器。 It lets you install many versions of Rust and easily switch between them. 它使您可以安装多个版本的Rust并在它们之间轻松切换。
The binary installed at ~/.cargo/bin/rustc
proxies to the current toolchain that you have selected. 安装在~/.cargo/bin/rustc
的二进制文件代理到您选择的当前工具链。 Each installed compiler is kept under the toolchains
directory. 每个已安装的编译器都保存在toolchains
目录下。
Although the compiler in the toolchains
directory appears to be a smaller file, that's only because it's dynamically linked instead of statically linked. 尽管toolchains
目录中的编译器似乎是一个较小的文件,但这仅是因为它是动态链接的,而不是静态链接的。
More information can be found on rustup's README . 可以在rustup的README上找到更多信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.