以下是 Cargo README 中所述的内容:
Compiling from Source
Cargo requires the following tools and packages to build:
python
curl
(on Unix)cmake
- OpenSSL headers (only for Unix, this is the
libssl-dev
package on ubuntu)cargo
andrustc
First, you'll want to check out this repository
git clone --recursive https://github.com/rust-lang/cargo cd cargo
With
cargo
already installed, you can simply run:cargo build --release
Otherwise, you can also use a more traditional approach:
./configure make make install
这说明Cargo是构建Cargo所需的依赖项,但也似乎表明如果未安装Cargo,则以./configure
开头的方法应该能正常工作。
当我克隆该存储库并运行./configure
时,出现错误。
...
configure: found cmake
configure: found make
configure: recreating config.tmp
configure:
configure: processing ./configure args
configure:
configure: CFG_PREFIX := /usr/local
configure: CFG_LOCAL_RUST_ROOT :=
configure: CFG_CARGO := cargo
configure: CFG_RUSTC := rustc
configure: CFG_RUSTDOC := rustdoc
configure: CFG_CARGO :=
configure: error: needed, but unable to find any of: CFG_CARGO cargo
这是否意味着我没有安装Cargo就无法从源代码构建Cargo?也许缺少一个传递给
configure
的参数?我从源代码构建了Rust,因为我在这个系统上不是特权用户,并且将其安装在我的用户目录中。