about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-12-13 09:17:33 -0800
committerAlex Crichton <alex@alexcrichton.com>2016-12-13 09:17:33 -0800
commitbbf2b708932288bb720acf66fdae2711b5940937 (patch)
treea6da72bc7a1b35d71538ad4c54d3040736ad70b4
parenta1f5001998ad43ee6ce5a933be737ed63317916f (diff)
downloadrust-bbf2b708932288bb720acf66fdae2711b5940937.tar.gz
rust-bbf2b708932288bb720acf66fdae2711b5940937.zip
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.
-rw-r--r--src/bootstrap/dist.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index a015f485205..245859b78d0 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -260,6 +260,14 @@ pub fn debugger_scripts(build: &Build,
 pub fn std(build: &Build, compiler: &Compiler, target: &str) {
     println!("Dist std stage{} ({} -> {})", compiler.stage, compiler.host,
              target);
+
+    // The only true set of target libraries came from the build triple, so
+    // let's reduce redundant work by only producing archives from that host.
+    if compiler.host != build.config.build {
+        println!("\tskipping, not a build host");
+        return
+    }
+
     let name = format!("rust-std-{}", package_vers(build));
     let image = tmpdir(build).join(format!("{}-{}-image", name, target));
     let _ = fs::remove_dir_all(&image);
@@ -294,10 +302,15 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
     println!("Dist analysis");
 
     if build.config.channel != "nightly" {
-        println!("Skipping dist-analysis - not on nightly channel");
+        println!("\tskipping - not on nightly channel");
         return;
     }
+    if compiler.host != build.config.build {
+        println!("\tskipping - not a build host");
+        return
+    }
     if compiler.stage != 2 {
+        println!("\tskipping - not stage2");
         return
     }