Skip to content

Commit 953d679

Browse files
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 rust-lang/cargo#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
2 parents bbdb21e + 4f13da7 commit 953d679

File tree

6 files changed

+5
-9
lines changed

6 files changed

+5
-9
lines changed

src/bootstrap/compile.rs

-4
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,6 @@ pub fn rustc(build: &Build, target: &str, compiler: &Compiler) {
276276
if build.is_rust_llvm(target) {
277277
cargo.env("LLVM_RUSTLLVM", "1");
278278
}
279-
if let Some(ref cfg_file) = build.flags.config {
280-
let cfg_path = t!(PathBuf::from(cfg_file).canonicalize());
281-
cargo.env("CFG_LLVM_TOML", cfg_path.into_os_string());
282-
}
283279
cargo.env("LLVM_CONFIG", build.llvm_config(target));
284280
let target_config = build.config.target_config.get(target);
285281
if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {

src/librustc_asan/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ fn main() {
3232
.build_target("asan")
3333
.build();
3434
}
35+
println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
3536
}

src/librustc_llvm/build.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ fn main() {
6060
});
6161

6262
println!("cargo:rerun-if-changed={}", llvm_config.display());
63-
64-
if let Some(cfg_toml) = env::var_os("CFG_LLVM_TOML") {
65-
let cfg_path = PathBuf::from(cfg_toml);
66-
println!("cargo:rerun-if-changed={}", cfg_path.display());
67-
}
63+
println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
6864

6965
// Test whether we're cross-compiling LLVM. This is a pretty rare case
7066
// currently where we're producing an LLVM for a different platform than

src/librustc_lsan/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ fn main() {
3232
.build_target("lsan")
3333
.build();
3434
}
35+
println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
3536
}

src/librustc_msan/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ fn main() {
3232
.build_target("msan")
3333
.build();
3434
}
35+
println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
3536
}

src/librustc_tsan/build.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ fn main() {
3232
.build_target("tsan")
3333
.build();
3434
}
35+
println!("cargo:rerun-if-env-changed=LLVM_CONFIG");
3536
}

0 commit comments

Comments
 (0)