Skip to content

Cannot build just stage 0 rust-std from rust-src with local rust #94781

@jonhoo

Description

@jonhoo

I'm trying to just rebuild the 1.59.0 standard library from rustc-src using the 1.59.0 compiler I have locally, but it appears not to work. Specifically, I tried this sequence of steps:

$ cargo --version
cargo 1.59.0 (49d8809dc 2022-02-10)
$ wget "https://static.rust-lang.org/dist/2022-02-24/rustc-1.59.0-src.tar.xz"
$ tar xf rustc-1.59.0-src.tar.xz
$ cd rustc-1.59.0-src
$ ./configure --enable-local-rust
$ ./x.py dist --stage 0 rust-std

I expected to see this happen: rust-std should get built

Instead, this happened:

Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[...]
    Finished release [optimized] target(s) in 30.15s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 tool fabricate (x86_64-unknown-linux-gnu)
   Compiling autocfg v1.0.0
   Compiling libc v0.2.108
   Compiling cfg-if v0.1.10
   Compiling maybe-uninit v2.0.0
   Compiling lazy_static v1.4.0
   Compiling cc v1.0.69
   Compiling pkg-config v0.3.18
   Compiling scopeguard v1.1.0
   Compiling rayon-core v1.7.1
   Compiling crc32fast v1.2.0
   Compiling bitflags v1.2.1
   Compiling cfg-if v1.0.0
   Compiling anyhow v1.0.51
   Compiling unicode-width v0.1.8
   Compiling adler v0.2.3
   Compiling strsim v0.8.0
   Compiling ansi_term v0.12.1
   Compiling vec_map v0.8.2
   Compiling yaml-rust v0.3.5
   Compiling either v1.6.0
   Compiling same-file v1.0.6
   Compiling remove_dir_all v0.5.3
warning: `-Z symbol-mangling-version` is deprecated; use `-C symbol-mangling-version`

error[E0463]: can't find crate for `std`

error: cannot find macro `vec` in this scope
   --> /home/jongje/.cargo/registry/src/github.202132.xyz-1ecc6299db9ec823/strsim-0.8.0/src/lib.rs:266:25
    |
266 |     let mut distances = vec![vec![0; b_len + 2]; a_len + 2];
    |                         ^^^

followed by a huge list of similar errors stemming from the lack of std.

Meta

rustc --version --verbose:

rustc 1.59.0 (9d1b2106e 2022-02-23)
binary: rustc
commit-hash: 9d1b2106e23b1abd32fce1f17267604a5102f57a
commit-date: 2022-02-23
host: x86_64-unknown-linux-gnu
release: 1.59.0
LLVM version: 13.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions