do not allow using local llvm while using rustc from ci

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2024-04-08 21:49:47 +03:00
parent 3f10032eb0
commit a7aa7fdd12
2 changed files with 14 additions and 3 deletions

View File

@ -50,7 +50,7 @@
#
# Note that many of the LLVM options are not currently supported for
# downloading. Currently only the "assertions" option can be toggled.
#download-ci-llvm = if rust.channel == "dev" { "if-unchanged" } else { false }
#download-ci-llvm = if rust.channel == "dev" || rust.download-rustc != false { "if-unchanged" } else { false }
# Indicates whether the LLVM build is a Release or Debug build
#optimize = true

View File

@ -2483,9 +2483,20 @@ impl Config {
llvm::is_ci_llvm_available(self, asserts)
}
};
match download_ci_llvm {
None => self.channel == "dev" && if_unchanged(),
Some(StringOrBool::Bool(b)) => b,
None => {
(self.channel == "dev" || self.download_rustc_commit.is_some()) && if_unchanged()
}
Some(StringOrBool::Bool(b)) => {
if !b && self.download_rustc_commit.is_some() {
panic!(
"`llvm.download-ci-llvm` cannot be set to `false` if `rust.download-rustc` is set to `true` or `if-unchanged`."
);
}
b
}
// FIXME: "if-available" is deprecated. Remove this block later (around mid 2024)
// to not break builds between the recent-to-old checkouts.
Some(StringOrBool::String(s)) if s == "if-available" => {