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

Bootstrap sometimes fails to build miri #118129

Open
RalfJung opened this issue Nov 21, 2023 · 3 comments
Open

Bootstrap sometimes fails to build miri #118129

RalfJung opened this issue Nov 21, 2023 · 3 comments
Labels
A-miri Area: The miri tool C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@RalfJung
Copy link
Member

Step to reproduce:

rm build/host/stage0* -rf
./x.py check library/std compiler/rustc src/tools/miri

Now Miri fails to build with >1800 errors. The first ones are:

error[E0464]: multiple candidates for `rmeta` dependency `rustc_ast` found
  --> src/tools/miri/src/lib.rs:53:1
   |
53 | extern crate rustc_ast;
   | ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: candidate #1: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_ast-11854d11a3563889.rmeta
   = note: candidate #2: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_ast-feb80e66ce1c74d4.rmeta

error[E0464]: multiple candidates for `rmeta` dependency `rustc_const_eval` found
  --> src/tools/miri/src/lib.rs:54:1
   |
54 | extern crate rustc_const_eval;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: candidate #1: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_const_eval-078a7b0d61866866.rmeta
   = note: candidate #2: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_const_eval-2fa8de12acbc8979.rmeta

error[E0464]: multiple candidates for `rmeta` dependency `rustc_data_structures` found
  --> src/tools/miri/src/lib.rs:55:1
   |
55 | extern crate rustc_data_structures;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: candidate #1: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_data_structures-93605ddb6ab78ed8.rmeta
   = note: candidate #2: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_data_structures-e65a21da042ec502.rmeta

error[E0464]: multiple candidates for `rmeta` dependency `rustc_errors` found
  --> src/tools/miri/src/lib.rs:56:1
   |
56 | extern crate rustc_errors;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: candidate #1: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_errors-792f00940afc5752.rmeta
   = note: candidate #2: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_errors-ddd5d12697277ea9.rmeta

error[E0464]: multiple candidates for `rmeta` dependency `rustc_hir` found
  --> src/tools/miri/src/lib.rs:57:1
   |
57 | extern crate rustc_hir;
   | ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: candidate #1: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_hir-37bcaf20f0254cb3.rmeta
   = note: candidate #2: /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_hir-6f8ad5718a5b342e.rmeta

However, if I now run ./x.py check miri, everything is fine. rm build/host/stage0* -rf && ./x.py check miri is also fine. Something about explicitly giving the three paths to build is throwing bootstrap off. And even more strangely, the same sequence of commands worked fine before #116828.

Cc @rust-lang/bootstrap

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 21, 2023
@fmease fmease added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. A-miri Area: The miri tool and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 2, 2023
@onur-ozkan
Copy link
Member

onur-ozkan commented Dec 3, 2023

compiler/rustc_index_macros should be compiled with its default feature nightly. However, in rustc_index, this feature disabled by default. When compiling these specific paths (library/std compiler/rustc src/tools/miri), rustc_index_macros is not built with its default feature.

A quick workaround for your case would be adding compiler/rustc_index_macros path in x check (like x check library/std compiler/rustc compiler/rustc_index_macros src/tools/miri).

@RalfJung
Copy link
Member Author

RalfJung commented Apr 4, 2024

FWIW I cannot reproduce the problem any more. Has this been fixed?

@RalfJung
Copy link
Member Author

RalfJung commented Apr 4, 2024

Actually never mind the issue still exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-miri Area: The miri tool C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

4 participants