about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-06-30 22:44:47 +0200
committerGitHub <noreply@github.com>2017-06-30 22:44:47 +0200
commit953d679362b4cb7a52fc25bdc5ac41e978a037bf (patch)
treea856fb47b914897ded4fe388b50eae61348fa906
parentbbdb21efbf0dfb882dac8899f35db05c4856e654 (diff)
parent4f13da736220fc0d5f3218ac2763617f20b10b89 (diff)
downloadrust-953d679362b4cb7a52fc25bdc5ac41e978a037bf.tar.gz
rust-953d679362b4cb7a52fc25bdc5ac41e978a037bf.zip
Rollup merge of #42985 - venkatagiri:issue_42444, r=Mark-Simulacrum
rustc_llvm: re-run build script when env var LLVM_CONFIG changes

This removes the changes done in #42429 and use the newly introduced `cargo:rerun-if-env-changed` in https://github.com/rust-lang/cargo/pull/4125.
As `LLVM_CONFIG` env var points to the `llvm-config` and changes when it gets configured in `config.toml` or removed from it, we can re-run the build script if this env var changes.

closes #42444

r? @alexcrichton
-rw-r--r--src/bootstrap/compile.rs4
-rw-r--r--src/librustc_asan/build.rs1
-rw-r--r--src/librustc_llvm/build.rs6
-rw-r--r--src/librustc_lsan/build.rs1
-rw-r--r--src/librustc_msan/build.rs1
-rw-r--r--src/librustc_tsan/build.rs1
6 files changed, 5 insertions, 9 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index c8ab3a8fc1d..b2bd792e93b 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -276,10 +276,6 @@ pub fn rustc(build: &Build, target: &str, compiler: &Compiler) {
     if build.is_rust_llvm(target) {
         cargo.env("LLVM_RUSTLLVM", "1");
     }
-    if let Some(ref cfg_file) = build.flags.config {
-        let cfg_path = t!(PathBuf::from(cfg_file).canonicalize());
-        cargo.env("CFG_LLVM_TOML", cfg_path.into_os_string());
-    }
     cargo.env("LLVM_CONFIG", build.llvm_config(target));
     let target_config = build.config.target_config.get(target);
     if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
diff --git a/src/librustc_asan/build.rs b/src/librustc_asan/build.rs
index 3a80baa0485..cb7721affe7 100644
--- a/src/librustc_asan/build.rs
+++ b/src/librustc_asan/build.rs
@@ -32,4 +32,5 @@ fn main() {
             .build_target("asan")
             .build();
     }
+    println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
 }
diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
index 01b37a55f4f..3f0f5369607 100644
--- a/src/librustc_llvm/build.rs
+++ b/src/librustc_llvm/build.rs
@@ -60,11 +60,7 @@ fn main() {
         });
 
     println!("cargo:rerun-if-changed={}", llvm_config.display());
-
-    if let Some(cfg_toml) = env::var_os("CFG_LLVM_TOML") {
-        let cfg_path = PathBuf::from(cfg_toml);
-        println!("cargo:rerun-if-changed={}", cfg_path.display());
-    }
+    println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
 
     // Test whether we're cross-compiling LLVM. This is a pretty rare case
     // currently where we're producing an LLVM for a different platform than
diff --git a/src/librustc_lsan/build.rs b/src/librustc_lsan/build.rs
index da53571a243..3d2ae480de6 100644
--- a/src/librustc_lsan/build.rs
+++ b/src/librustc_lsan/build.rs
@@ -32,4 +32,5 @@ fn main() {
             .build_target("lsan")
             .build();
     }
+    println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
 }
diff --git a/src/librustc_msan/build.rs b/src/librustc_msan/build.rs
index dcadbe86966..7e2a82dd0ab 100644
--- a/src/librustc_msan/build.rs
+++ b/src/librustc_msan/build.rs
@@ -32,4 +32,5 @@ fn main() {
             .build_target("msan")
             .build();
     }
+    println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
 }
diff --git a/src/librustc_tsan/build.rs b/src/librustc_tsan/build.rs
index 5ea52f17a0f..641d9c3647d 100644
--- a/src/librustc_tsan/build.rs
+++ b/src/librustc_tsan/build.rs
@@ -32,4 +32,5 @@ fn main() {
             .build_target("tsan")
             .build();
     }
+    println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
 }