Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 13 additions & 2 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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" => {
Expand Down