Skip to content

Commit

Permalink
Rollup merge of rust-lang#110113 - jyn514:download-rustc-cross, r=alb…
Browse files Browse the repository at this point in the history
…ertlarsan68

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 rust-lang#81930.
  • Loading branch information
Dylan-DPC authored Apr 11, 2023
2 parents 84e1659 + 47ff60d commit 539b741
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ impl Step for Std {
let target = self.target;
let compiler = self.compiler;

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

Expand Down

0 comments on commit 539b741

Please sign in to comment.