Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jonhoo opened this issue Mar 9, 2022 · 8 comments
Closed

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

jonhoo opened this issue Mar 9, 2022 · 8 comments
Labels
C-bug Category: This is a bug.

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Mar 9, 2022

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.com-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
@jonhoo jonhoo added the C-bug Category: This is a bug. label Mar 9, 2022
@jonhoo
Copy link
Contributor Author

jonhoo commented Mar 9, 2022

This might be related to #51698, I'm not sure?

@jonhoo
Copy link
Contributor Author

jonhoo commented Mar 10, 2022

I'll add that ./x.py dist rust-std (so without --stage 0) gives

[..]
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-g[7775/90826]
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[..]
    Finished release [optimized] target(s) in 38.31s
Copying stage1 std from stage1 (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 scopeguard v1.1.0
   Compiling rayon-core v1.7.1
   Compiling pkg-config v0.3.18
   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 yaml-rust v0.3.5
   Compiling either v1.6.0
   Compiling same-file v1.0.6
   Compiling strsim v0.8.0
   Compiling ansi_term v0.12.1
   Compiling vec_map v0.8.2
   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 `core`

@RalfJung
Copy link
Member

Cc @jyn514

x.py dist can be odd, not sure to what extent this is expected behavior.

@jyn514
Copy link
Member

jyn514 commented Mar 18, 2022

I haven't worked much on x.py dist or install. Your best bet is to ask on zulip.

@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

@jonhoo are you still hitting this with later versions, or was only 1.59 buggy?

@jonhoo
Copy link
Contributor Author

jonhoo commented Feb 6, 2023

No, interestingly enough I can no longer reproduce this with 2023-01-26/rustc-src-1.67.0, so guess this can be closed!

@jonhoo jonhoo closed this as completed Feb 6, 2023
@jyn514
Copy link
Member

jyn514 commented Feb 6, 2023

Ok. I think long-term we should look into testing local rebuild in CI, which would avoid problems like this and #107349, but looks like this particular problem was fixed.

cc @cuviper, would you be interested in setting up that CI?

@cuviper
Copy link
Member

cuviper commented Feb 7, 2023

I would definitely like to have that -- I'll put it on my list if I can find the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants