gpt4 book ai didi

rust - Cargo 是否依赖于从源代码构建 Cargo 本身?

转载 作者:行者123 更新时间:2023-11-29 08:08:40 34 4
gpt4 key购买 nike

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 and rustc

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 开头的方法应该有效。

当我克隆那个 repo 并运行 ./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,因为我不是这个系统的特权用户,并且在我的用户目录中安装了 Rust。

最佳答案

根据这里的讨论Issue 3772 :

Indeed yeah Cargo is required to compile Cargo. In future Rust releases we'll have --enable-extended which will compile Cargo as well as Rust.

但是可以找到一些 cargo bootstrapping 脚本。例如:https://github.com/dhuseby/cargo-bootstrap .

关于rust - Cargo 是否依赖于从源代码构建 Cargo 本身?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43004405/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com