From 04e7cecc681fa1bdeb46eb2b6af7ec5b347bfb03 Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Wed, 9 Oct 2024 19:26:22 +0300 Subject: [PATCH] disable `download-rustc` if LLVM submodule has changes in CI Signed-off-by: onur-ozkan --- src/bootstrap/src/core/config/config.rs | 13 +++++++++++++ src/doc/rustc-dev-guide | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 9f84b492b80a2..4c4957b273a3d 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -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, diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide index 07bc9ca9eb1cd..555f3de2fa0d6 160000 --- a/src/doc/rustc-dev-guide +++ b/src/doc/rustc-dev-guide @@ -1 +1 @@ -Subproject commit 07bc9ca9eb1cd6d9fbbf758c2753b748804a134f +Subproject commit 555f3de2fa0d61c4294b74d245f1cbad6fcbf589