]> git.lizzy.rs Git - rust.git/commitdiff
rustbuild: Make save-analysis an option
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Thu, 9 Mar 2017 08:49:37 +0000 (17:49 +0900)
committerTatsuyuki Ishi <ishitatsuyuki@gmail.com>
Sat, 11 Mar 2017 11:00:05 +0000 (20:00 +0900)
configure
src/bootstrap/config.rs
src/bootstrap/config.toml.example
src/bootstrap/dist.rs
src/bootstrap/lib.rs
src/ci/run.sh

index d8861dacafac1091c3deb54ab211f54bc3d4e058..fae457e9c0b159d08fea816e75775b295f0a0e0c 100755 (executable)
--- a/configure
+++ b/configure
@@ -645,6 +645,7 @@ opt dist-host-only 0 "only install bins for the host architecture"
 opt inject-std-version 1 "inject the current compiler version of libstd into programs"
 opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
 opt codegen-tests 1 "run the src/test/codegen tests"
+opt save-analysis 0 "save API analysis data"
 opt option-checking 1 "complain about unrecognized options in this configure script"
 opt ninja 0 "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)"
 opt locked-deps 0 "force Cargo.lock to be up to date"
index 87c35e0502ce6d853ce5ad0ff95e1668b9bacead..b65277035498948f99c87d93c5cb9c7ff5afbe7c 100644 (file)
@@ -73,6 +73,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,
@@ -223,6 +224,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.
@@ -347,6 +349,7 @@ pub fn parse(build: &str, file: Option<PathBuf>) -> 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);
@@ -453,6 +456,7 @@ macro_rules! check {
                 ("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),
index 776bd729119e24458de1038d90252139159420a4..42cf3dcabf4eafa4d82acaddd3e4788c69937f99 100644 (file)
 # 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
 #
index 5c4b718490c0cfe977d424ed8029254d76e75032..30f4f6b33df4a98bef23e0d16dd7747f4306979e 100644 (file)
@@ -313,16 +313,8 @@ pub fn rust_src_location(build: &Build) -> PathBuf {
 pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
     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
     }
 
index 4831b380837407e1407a98339f215055bbc139de..f234db98bc3f454596d271b9c92356a6552618dc 100644 (file)
@@ -524,7 +524,7 @@ fn cargo(&self,
                  .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());
         }
 
index 4c4836d7ca2301f9ded0d7766af01ee05056dd72..55c6196b1ae732e3951a2e7ed94d7d6b213c67f3 100755 (executable)
@@ -42,6 +42,7 @@ fi
 if [ "$DEPLOY$DEPLOY_ALT" != "" ]; then
   RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=nightly"
   RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
+  RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-save-analysis"
 
   if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
     RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"