Skip to content

Commit

Permalink
Make download-ci-llvm = true check if CI llvm is available
Browse files Browse the repository at this point in the history
and make it the default for the compiler profile, as to prevent
unnecessarily checking out `src/llvm-project` with `"if-unchanged"`.
  • Loading branch information
Urgau committed Sep 5, 2024
1 parent a60a9e5 commit 9fed172
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
# Unless you're developing for a target where Rust CI doesn't build a compiler
# toolchain or changing LLVM locally, you probably want to leave this enabled.
#
# Set this to `"true"` to download if CI llvm available otherwise it builds
# from `src/llvm-project`.
#
# Set this to `"if-unchanged"` to download only if the llvm-project has not
# been modified. You can also use this if you are unsure whether you're on a
# tier 1 target. All tier 1 targets are currently supported.
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/defaults/config.compiler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ assertions = false
# Enable warnings during the LLVM compilation (when LLVM is changed, causing a compilation)
enable-warnings = true
# Will download LLVM from CI if available on your platform.
download-ci-llvm = "if-unchanged"
# If you intend to modify `src/llvm-project`, use `download-ci-llvm = "if-unchanged"` or `download-ci-llvm = false` instead.
download-ci-llvm = true
3 changes: 2 additions & 1 deletion src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2760,7 +2760,8 @@ impl Config {
);
}

b
// If download-ci-llvm=true we also want to check that CI llvm is available
b && llvm::is_ci_llvm_available(self, asserts)
}
Some(StringOrBool::String(s)) if s == "if-unchanged" => if_unchanged(),
Some(StringOrBool::String(other)) => {
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "./x test --rustc-args was renamed to --compiletest-rustc-args as it only applies there. ./x miri --rustc-args was also removed.",
},
ChangeInfo {
change_id: 129473,
severity: ChangeSeverity::Warning,
summary: "`download-ci-llvm = true` now checks if CI llvm is available and has become the default for the compiler profile",
},
];

0 comments on commit 9fed172

Please sign in to comment.