about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2017-03-16 21:56:52 -0400
committerGitHub <noreply@github.com>2017-03-16 21:56:52 -0400
commitbc6eecd0c2ed7854d52fc823be0b093f3bc76ba8 (patch)
treeba624a9e66a33fec8bcc8bc93734d03acbdd6688 /src/bootstrap
parent6adbbfc6ba8786ea91e1051ea14d64a91839f5b5 (diff)
parent0aeb9c12979e6da753701a798d04105b6b1a8c28 (diff)
Merge branch 'master' into frewsxcv-osstr
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/config.rs4
-rw-r--r--src/bootstrap/config.toml.example3
-rw-r--r--src/bootstrap/dist.rs14
-rw-r--r--src/bootstrap/install.rs4
-rw-r--r--src/bootstrap/lib.rs2
5 files changed, 17 insertions, 10 deletions
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
index dcd49c51e3a..b1d1d79b9ea 100644
--- a/src/bootstrap/config.rs
+++ b/src/bootstrap/config.rs
@@ -74,6 +74,7 @@ pub struct Config {
     pub rustc_default_ar: Option<String>,
     pub rust_optimize_tests: bool,
     pub rust_debuginfo_tests: bool,
+    pub rust_save_analysis: bool,
     pub rust_dist_src: bool,
 
     pub build: String,
@@ -225,6 +226,7 @@ struct Rust {
     optimize_tests: Option<bool>,
     debuginfo_tests: Option<bool>,
     codegen_tests: Option<bool>,
+    save_analysis: Option<bool>,
 }
 
 /// TOML representation of how each build target is configured.
@@ -350,6 +352,7 @@ impl Config {
             set(&mut config.rust_optimize_tests, rust.optimize_tests);
             set(&mut config.rust_debuginfo_tests, rust.debuginfo_tests);
             set(&mut config.codegen_tests, rust.codegen_tests);
+            set(&mut config.rust_save_analysis, rust.save_analysis);
             set(&mut config.rust_rpath, rust.rpath);
             set(&mut config.debug_jemalloc, rust.debug_jemalloc);
             set(&mut config.use_jemalloc, rust.use_jemalloc);
@@ -457,6 +460,7 @@ impl Config {
                 ("LOCAL_REBUILD", self.local_rebuild),
                 ("NINJA", self.ninja),
                 ("CODEGEN_TESTS", self.codegen_tests),
+                ("SAVE_ANALYSIS", self.rust_save_analysis),
                 ("LOCKED_DEPS", self.locked_deps),
                 ("VENDOR", self.vendor),
                 ("FULL_BOOTSTRAP", self.full_bootstrap),
diff --git a/src/bootstrap/config.toml.example b/src/bootstrap/config.toml.example
index 5a00e90f370..76fedae0f03 100644
--- a/src/bootstrap/config.toml.example
+++ b/src/bootstrap/config.toml.example
@@ -234,6 +234,9 @@
 # saying that the FileCheck executable is missing, you may want to disable this.
 #codegen-tests = true
 
+# Flag indicating whether the API analysis data should be saved.
+#save-analysis = false
+
 # =============================================================================
 # Options for specific targets
 #
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 7c463bec5ff..289c1e1c3a9 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -311,18 +311,14 @@ pub fn rust_src_location(build: &Build) -> PathBuf {
 
 /// Creates a tarball of save-analysis metadata, if available.
 pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
+    if !build.config.rust_save_analysis {
+        return
+    }
+
     println!("Dist analysis");
 
-    if build.config.channel != "nightly" {
-        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");
+        println!("\tskipping, not a build host");
         return
     }
 
diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs
index ba8442ebd8c..249f241a151 100644
--- a/src/bootstrap/install.rs
+++ b/src/bootstrap/install.rs
@@ -49,6 +49,10 @@ pub fn install(build: &Build, stage: u32, host: &str) {
         install_sh(&build, "docs", "rust-docs", stage, host, &prefix,
                    &docdir, &libdir, &mandir, &empty_dir);
     }
+    if build.config.rust_save_analysis {
+        install_sh(&build, "analysis", "rust-analysis", stage, host, &prefix,
+                   &docdir, &libdir, &mandir, &empty_dir);
+    }
     install_sh(&build, "std", "rust-std", stage, host, &prefix,
                &docdir, &libdir, &mandir, &empty_dir);
     install_sh(&build, "rustc", "rustc", stage, host, &prefix,
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 72aec15e532..2d2be531e62 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -524,7 +524,7 @@ impl Build {
                  .env(format!("CFLAGS_{}", target), self.cflags(target).join(" "));
         }
 
-        if self.config.channel == "nightly" && compiler.is_final_stage(self) {
+        if self.config.rust_save_analysis && compiler.is_final_stage(self) {
             cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
         }