Closed
Description
cc #81930
I tried this code:
./configure --set rust.download-rustc
x test --stage 2 library/core
I expected to see this happen: Bootstrap uses the stage 2 compiler to run the tests.
Instead, this happened: Bootstrap uses the stage 1 compiler:
Testing {core} stage1 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
Compiling core v0.0.0 (/home/gh-jyn514/rust/library/core)
error[E0773]: attempted to define built-in macro more than once
--> /home/gh-jyn514/rust/library/core/src/macros/mod.rs:1310:5
|
1310 | macro_rules! cfg {
| ^^^^^^^^^^^^^^^^
|
note: previously defined here
--> /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/ci-rustc-sysroot/lib/rustlib/src/rust/library/core/src/macros/mod.rs:13
10:5
|
1310 | macro_rules! cfg {
| ^^^^^^^^^^^^^^^^
error[E0152]: duplicate lang item in crate `core` (which `corebenches` depends on): `sized`.
|
= note: the lang item is first defined in crate `core` (which `std` depends on)
= note: first definition in `core` loaded from /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/ci-rustc-sysroot/lib/rustlib/a
arch64-unknown-linux-gnu/lib/libcore-d20cd64dc93f727e.rlib
= note: second definition in `core` loaded from /home/gh-jyn514/rust/build/aarch64-unknown-linux-gnu/stage1-std/aarch64-unknown-li
nux-gnu/release/deps/libcore-8c941efb0bc89716.rlib
I think the right fix is to unconditionally use the stage 2 compiler in compiler_for
when config.download_rustc
is set:
Line 2103 in 2f16355
Lines 1206 to 1210 in a5d2731
Meta
HEAD is 35636f9
Metadata
Metadata
Assignees
Labels
Area: The `rust.download-rustc` build option.Category: This is a bug.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)