about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-08-02 07:30:40 +0200
committerGitHub <noreply@github.com>2022-08-02 07:30:40 +0200
commit3357470fb73d6a6dbf636ec96e5eb4936cfe29f8 (patch)
treec20c5d21f5f15a317a322f45e2661ef089e44ef3
parent06294453001ec64d4d3b9085fc0b7129923ee5df (diff)
parentc5d661a01cd085c26417b90b57c86e01ea1009f3 (diff)
downloadrust-3357470fb73d6a6dbf636ec96e5eb4936cfe29f8.tar.gz
rust-3357470fb73d6a6dbf636ec96e5eb4936cfe29f8.zip
Rollup merge of #99293 - jo3bingham:issue-98720-fix, r=jyn514
only run --all-targets in stage0 for Std

Repro'd the issue with `python3 x.py check --stage 1 library/std` and tested the fix with the same command.

r? `@jyn514`

I tried to implement [this solution](https://github.com/rust-lang/rust/issues/98720#issuecomment-1184435462), but didn't have any luck. I don't think I fully understood what needed to be done. However, I would love to be mentored on it since it would be a more correct solution, and I can learn more about how bootstrap works.
-rw-r--r--src/bootstrap/check.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs
index 394bd8b4e28..4e1e8ef9dea 100644
--- a/src/bootstrap/check.rs
+++ b/src/bootstrap/check.rs
@@ -140,7 +140,13 @@ impl Step for Std {
             cargo_subcommand(builder.kind),
         );
 
-        cargo.arg("--all-targets");
+        // If we're not in stage 0, tests and examples will fail to compile
+        // from `core` definitions being loaded from two different `libcore`
+        // .rmeta and .rlib files.
+        if compiler.stage == 0 {
+            cargo.arg("--all-targets");
+        }
+
         std_cargo(builder, target, compiler.stage, &mut cargo);
 
         // Explicitly pass -p for all dependencies krates -- this will force cargo