Skip to content

Commit de19f2b

Browse files
committed
Auto merge of rust-lang#131453 - onur-ozkan:llvm-ci-check-for-rustc-ci, r=Kobzol
disable `download-rustc` if LLVM submodule has changes in CI We can't use CI rustc while using in-tree LLVM (which happens in LLVM submodule update PRs) and this PR handles that by ignoring CI-rustc in CI and failing in non-CI environments.
2 parents df1b5d3 + b198a46 commit de19f2b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: src/bootstrap/src/core/config/config.rs

+14
Original file line numberDiff line numberDiff line change
@@ -2399,6 +2399,20 @@ impl Config {
23992399
Some(commit) => {
24002400
self.download_ci_rustc(commit);
24012401

2402+
// CI-rustc can't be used without CI-LLVM. If `self.llvm_from_ci` is false, it means the "if-unchanged"
2403+
// logic has detected some changes in the LLVM submodule (download-ci-llvm=false can't happen here as
2404+
// we don't allow it while parsing the configuration).
2405+
if !self.llvm_from_ci {
2406+
// This happens when LLVM submodule is updated in CI, we should disable ci-rustc without an error
2407+
// to not break CI. For non-CI environments, we should return an error.
2408+
if CiEnv::is_ci() {
2409+
println!("WARNING: LLVM submodule has changes, `download-rustc` will be disabled.");
2410+
return None;
2411+
} else {
2412+
panic!("ERROR: LLVM submodule has changes, `download-rustc` can't be used.");
2413+
}
2414+
}
2415+
24022416
if let Some(config_path) = &self.config {
24032417
let ci_config_toml = match self.get_builder_toml("ci-rustc") {
24042418
Ok(ci_config_toml) => ci_config_toml,

0 commit comments

Comments
 (0)