Skip to content

Commit

Permalink
disable download-rustc if LLVM submodule has changes in CI
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Oct 10, 2024
1 parent 7a0e8bd commit 77e3225
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2399,6 +2399,19 @@ impl Config {
Some(commit) => {
self.download_ci_rustc(commit);

// We never enable `download-rustc` without `download-ci-llvm`. If `self.llvm_from_ci` is false,
// it means the "if-unchanged" logic has detected some changes in the LLVM submodule.
if CiEnv::is_ci() && !self.llvm_from_ci {
// This happens when LLVM submodule is updated in CI, we should disable ci-rustc without an error
// to not break CI. For non-CI environments, we should return an error.
if CiEnv::is_ci() {
println!("WARNING: LLVM submodule has changes, `download-rustc` will be disabled.");
return None;
} else {
panic!("ERROR: LLVM submodule has changes, `download-rustc` can't be used.");
}
}

if let Some(config_path) = &self.config {
let ci_config_toml = match self.get_builder_toml("ci-rustc") {
Ok(ci_config_toml) => ci_config_toml,
Expand Down

0 comments on commit 77e3225

Please sign in to comment.