Skip to content

Commit 2c5ae52

Browse files
committed
rustbuild: Actually don't build stage0 target rustc
This was attempted in #38853 but erroneously forgot one more case of where the compiler was compiled. This commit fixes that up and adds a test to ensure this doesn't sneak back in.
1 parent b27c709 commit 2c5ae52

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/bootstrap/step.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
545545
.run(move |s| doc::standalone(build, s.target));
546546
rules.doc("doc-error-index", "src/tools/error_index_generator")
547547
.dep(move |s| s.name("tool-error-index").target(&build.config.build).stage(0))
548-
.dep(move |s| s.name("librustc-link").stage(0))
548+
.dep(move |s| s.name("librustc-link"))
549549
.default(build.config.docs)
550550
.host(true)
551551
.run(move |s| doc::error_index(build, s.target));
@@ -1306,6 +1306,18 @@ mod tests {
13061306
println!("all rules: {:#?}", all);
13071307
assert!(!all.contains(&step.name("rustc")));
13081308
assert!(!all.contains(&step.name("build-crate-std_shim").stage(1)));
1309+
1310+
// all stage0 compiles should be for the build target, A
1311+
for step in all.iter().filter(|s| s.stage == 0) {
1312+
if !step.name.contains("build-crate") {
1313+
continue
1314+
}
1315+
println!("step: {:?}", step);
1316+
assert!(step.host != "B");
1317+
assert!(step.target != "B");
1318+
assert!(step.host != "C");
1319+
assert!(step.target != "C");
1320+
}
13091321
}
13101322

13111323
#[test]

0 commit comments

Comments
 (0)