Skip to content

Commit 3418447

Browse files
committed
Fix x.py check for download-stage1
Previously, it would error out: ``` Checking compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) Checking cfg-if v0.1.10 Compiling autocfg v1.0.0 Compiling libc v0.2.79 Compiling proc-macro2 v1.0.19 error[E0464]: multiple matching crates for `std` | = note: candidates: crate `std`: /home/joshua/src/rust/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-25c6acf8063a3802.so /home/joshua/src/rust/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-25c6acf8063a3802.rlib ``` and the error would persist past `x.py check`: ``` Compiling bootstrap v0.0.0 (/home/joshua/src/rust/rust/src/bootstrap) error[E0464]: multiple matching crates for `std` | = note: candidates: crate `std`: /home/joshua/src/rust/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-25c6acf8063a3802.rlib ``` I think the issue was that bootstrap was adding the check metadata to the sysroot, so that it could check `libtest`; that ended up having two different versions of libstd in sysroot. Now the metadata is added to stage1 instead, which avoids the duplicate version. Additionally, this doesn't check rustc artifacts when `download-stage1` is set; it takes a relatively long time and the `compiler/` directory shouldn't have changes anyway.
1 parent e29b201 commit 3418447

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/bootstrap/check.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ impl Step for Std {
7373

7474
fn run(self, builder: &Builder<'_>) {
7575
let target = self.target;
76-
let compiler = builder.compiler(0, builder.config.build);
76+
let stage = if builder.config.download_stage1 { 1 } else { 0 };
77+
let compiler = builder.compiler(stage, builder.config.build);
7778

7879
let mut cargo = builder.cargo(
7980
compiler,
@@ -84,7 +85,10 @@ impl Step for Std {
8485
);
8586
std_cargo(builder, target, compiler.stage, &mut cargo);
8687

87-
builder.info(&format!("Checking std artifacts ({} -> {})", &compiler.host, target));
88+
builder.info(&format!(
89+
"Checking stage {} std artifacts ({} -> {})",
90+
stage, &compiler.host, target
91+
));
8892
run_cargo(
8993
builder,
9094
cargo,
@@ -124,8 +128,8 @@ impl Step for Std {
124128
}
125129

126130
builder.info(&format!(
127-
"Checking std test/bench/example targets ({} -> {})",
128-
&compiler.host, target
131+
"Checking stage {} std test/bench/example targets ({} -> {})",
132+
stage, &compiler.host, target
129133
));
130134
run_cargo(
131135
builder,
@@ -163,6 +167,9 @@ impl Step for Rustc {
163167
/// the `compiler` targeting the `target` architecture. The artifacts
164168
/// created will also be linked into the sysroot directory.
165169
fn run(self, builder: &Builder<'_>) {
170+
if builder.config.download_stage1 {
171+
return;
172+
}
166173
let compiler = builder.compiler(0, builder.config.build);
167174
let target = self.target;
168175

0 commit comments

Comments
 (0)