Skip to content

Commit 1ca2708

Browse files
committed
sync llvm submodule during config parse
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 3d0f3b2 commit 1ca2708

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/bootstrap/src/core/config/config.rs

+16-12
Original file line numberDiff line numberDiff line change
@@ -2730,19 +2730,23 @@ impl Config {
27302730
asserts: bool,
27312731
) -> bool {
27322732
let if_unchanged = || {
2733-
// Git is needed to track modifications here, but tarball source is not available.
2734-
// If not modified here or built through tarball source, we maintain consistency
2735-
// with '"if available"'.
2736-
if !self.rust_info.is_from_tarball()
2737-
&& self
2738-
.last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true)
2739-
.is_none()
2740-
{
2741-
// there are some untracked changes in the given paths.
2742-
false
2743-
} else {
2744-
llvm::is_ci_llvm_available(self, asserts)
2733+
if self.rust_info.is_from_tarball() {
2734+
// Git is needed for running "if-unchanged" logic.
2735+
println!(
2736+
"WARNING: 'if-unchanged' has no effect on tarball sources; ignoring `download-ci-llvm`."
2737+
);
2738+
return false;
27452739
}
2740+
2741+
self.update_submodule("src/llvm-project");
2742+
2743+
// Check for untracked changes in `src/llvm-project`.
2744+
let has_changes = self
2745+
.last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true)
2746+
.is_none();
2747+
2748+
// Return false if there are untracked changes, otherwise check if CI LLVM is available.
2749+
if has_changes { false } else { llvm::is_ci_llvm_available(self, asserts) }
27462750
};
27472751

27482752
match download_ci_llvm {

0 commit comments

Comments
 (0)