Skip to content

Commit 2f5440c

Browse files
Rollup merge of #110113 - jyn514:download-rustc-cross, r=albertlarsan68
Fix `x test ui --target foo` when download-rustc is enabled Previously, we would never build the target std, only the host std: ``` ; x t tests/ui/attributes --target wasm32-unknown-unknown Building bootstrap Finished dev [unoptimized] target(s) in 0.02s Building stage0 library artifacts (x86_64-unknown-linux-gnu) Finished release [optimized] target(s) in 0.08s Building tool compiletest (stage0) Finished release [optimized] target(s) in 0.09s Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> wasm32-unknown-unknown) thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { depth: 0, inner: Io { path: Some("/home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/wasm32-unknown-unknown/lib"), err: Os { code: 2, kind: NotFound, message: "No such file or directory" } } }', src/tools/compiletest/src/main.rs:842:31 ``` Helps with #81930.
2 parents 4f2f7fd + 47ff60d commit 2f5440c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bootstrap/compile.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ impl Step for Std {
8383
let target = self.target;
8484
let compiler = self.compiler;
8585

86-
// These artifacts were already copied (in `impl Step for Sysroot`).
87-
// Don't recompile them.
86+
// When using `download-rustc`, we already have artifacts for the host available
87+
// (they were copied in `impl Step for Sysroot`). Don't recompile them.
8888
// NOTE: the ABI of the beta compiler is different from the ABI of the downloaded compiler,
8989
// so its artifacts can't be reused.
90-
if builder.download_rustc() && compiler.stage != 0 {
90+
if builder.download_rustc() && compiler.stage != 0 && target == builder.build.build {
9191
return;
9292
}
9393

0 commit comments

Comments
 (0)