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:
|
let compiler = builder.compiler_for(builder.top_stage, host, host); |
|
fn force_use_stage1(&self, compiler: Compiler, target: TargetSelection) -> bool { |
|
!self.config.full_bootstrap |
|
&& compiler.stage >= 2 |
|
&& (self.hosts.iter().any(|h| *h == target) || target == self.build) |
|
} |
Meta
HEAD is 35636f9
cc #81930
I tried this code:
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:
I think the right fix is to unconditionally use the stage 2 compiler in
compiler_forwhenconfig.download_rustcis set:rust/src/bootstrap/test.rs
Line 2103 in 2f16355
rust/src/bootstrap/lib.rs
Lines 1206 to 1210 in a5d2731
Meta
HEAD is 35636f9