Skip to content

Commit bbf2b70

Browse files
committed
rustbuild: Skip some more non-relevant dist steps
This commit skips a few more dist tragets during compilation which shouldn't be necessary. * First, when packaging std we only take action when the host target is the build target. Otherwise we package the same artifacts a number of times, which shouldn't be necessary. * Next, we apply the same logic to the save-analysis build. This is actually required for correctness as the build compiler is the only one which actually has save analysis information. This should fix an error seen on nightlies.
1 parent a1f5001 commit bbf2b70

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/bootstrap/dist.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,14 @@ pub fn debugger_scripts(build: &Build,
260260
pub fn std(build: &Build, compiler: &Compiler, target: &str) {
261261
println!("Dist std stage{} ({} -> {})", compiler.stage, compiler.host,
262262
target);
263+
264+
// The only true set of target libraries came from the build triple, so
265+
// let's reduce redundant work by only producing archives from that host.
266+
if compiler.host != build.config.build {
267+
println!("\tskipping, not a build host");
268+
return
269+
}
270+
263271
let name = format!("rust-std-{}", package_vers(build));
264272
let image = tmpdir(build).join(format!("{}-{}-image", name, target));
265273
let _ = fs::remove_dir_all(&image);
@@ -294,10 +302,15 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
294302
println!("Dist analysis");
295303

296304
if build.config.channel != "nightly" {
297-
println!("Skipping dist-analysis - not on nightly channel");
305+
println!("\tskipping - not on nightly channel");
298306
return;
299307
}
308+
if compiler.host != build.config.build {
309+
println!("\tskipping - not a build host");
310+
return
311+
}
300312
if compiler.stage != 2 {
313+
println!("\tskipping - not stage2");
301314
return
302315
}
303316

0 commit comments

Comments
 (0)