From bb7c483e48ea992f3759fb643962e1e706c8c029 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 14 Dec 2023 09:54:14 +0100 Subject: [PATCH 1/3] Update to LLVM 17.0.6 --- .gitmodules | 2 +- src/llvm-project | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index f5025097a18dc..9bb68b37081f5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -33,7 +33,7 @@ [submodule "src/llvm-project"] path = src/llvm-project url = https://github.com/rust-lang/llvm-project.git - branch = rustc/17.0-2023-09-19 + branch = rustc/17.0-2023-12-14 shallow = true [submodule "src/doc/embedded-book"] path = src/doc/embedded-book diff --git a/src/llvm-project b/src/llvm-project index 7738295178045..17a687b23d223 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 7738295178045041669876bf32b0543ec8319a5c +Subproject commit 17a687b23d22332fce6ba0aade180a30d06cfa62 From 5a8d6e784d0c3551039b7c96391938a2ce006257 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 14 Dec 2023 15:52:47 +0100 Subject: [PATCH 2/3] Fix bootstrap test failures There are a number of fixes here: * if-unchanged is supposed to be the default for channel=dev, but actually used different logic. Make sure it is the same. * If no llvm section was specified at all, different logic was also used. Go through the standard helper. * Some more assertions should depend on if_unchanged. --- src/bootstrap/src/core/config/config.rs | 36 ++++++++++++------------- src/bootstrap/src/tests/config.rs | 6 ++--- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index c3db5641ea47e..0c0f3909edf8c 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1791,8 +1791,7 @@ impl Config { config.llvm_link_shared.set(Some(true)); } } else { - config.llvm_from_ci = config.channel == "dev" - && crate::core::build_steps::llvm::is_ci_llvm_available(&config, false); + config.llvm_from_ci = config.parse_download_ci_llvm(None, false); } if let Some(t) = toml.target { @@ -2337,29 +2336,30 @@ impl Config { download_ci_llvm: Option, asserts: bool, ) -> bool { + let if_unchanged = || { + // Git is needed to track modifications here, but tarball source is not available. + // If not modified here or built through tarball source, we maintain consistency + // with '"if available"'. + if !self.rust_info.is_from_tarball() + && self + .last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true) + .is_none() + { + // there are some untracked changes in the the given paths. + false + } else { + llvm::is_ci_llvm_available(&self, asserts) + } + }; match download_ci_llvm { - None => self.channel == "dev" && llvm::is_ci_llvm_available(&self, asserts), + None => self.channel == "dev" && if_unchanged(), Some(StringOrBool::Bool(b)) => 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" => { llvm::is_ci_llvm_available(&self, asserts) } - Some(StringOrBool::String(s)) if s == "if-unchanged" => { - // Git is needed to track modifications here, but tarball source is not available. - // If not modified here or built through tarball source, we maintain consistency - // with '"if available"'. - if !self.rust_info.is_from_tarball() - && self - .last_modified_commit(&["src/llvm-project"], "download-ci-llvm", true) - .is_none() - { - // there are some untracked changes in the the given paths. - false - } else { - llvm::is_ci_llvm_available(&self, asserts) - } - } + Some(StringOrBool::String(s)) if s == "if-unchanged" => if_unchanged(), Some(StringOrBool::String(other)) => { panic!("unrecognized option for download-ci-llvm: {:?}", other) } diff --git a/src/bootstrap/src/tests/config.rs b/src/bootstrap/src/tests/config.rs index c24d57fb8f82c..6f43234388266 100644 --- a/src/bootstrap/src/tests/config.rs +++ b/src/bootstrap/src/tests/config.rs @@ -31,10 +31,10 @@ fn download_ci_llvm() { assert_eq!(parse_llvm(""), if_unchanged); assert_eq!(parse_llvm("rust.channel = \"dev\""), if_unchanged); assert!(!parse_llvm("rust.channel = \"stable\"")); - assert!(parse_llvm("build.build = \"x86_64-unknown-linux-gnu\"")); - assert!(parse_llvm( + assert_eq!(parse_llvm("build.build = \"x86_64-unknown-linux-gnu\""), if_unchanged); + assert_eq!(parse_llvm( "llvm.assertions = true \r\n build.build = \"x86_64-unknown-linux-gnu\" \r\n llvm.download-ci-llvm = \"if-unchanged\"" - )); + ), if_unchanged); assert!(!parse_llvm( "llvm.assertions = true \r\n build.build = \"aarch64-apple-darwin\" \r\n llvm.download-ci-llvm = \"if-unchanged\"" )); From 601d52a7031f0f57562b661c99d30b4035d7b4af Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 14 Dec 2023 16:05:39 +0100 Subject: [PATCH 3/3] Include an additional cherry-pick --- src/llvm-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llvm-project b/src/llvm-project index 17a687b23d223..2c4de6c2492d5 160000 --- a/src/llvm-project +++ b/src/llvm-project @@ -1 +1 @@ -Subproject commit 17a687b23d22332fce6ba0aade180a30d06cfa62 +Subproject commit 2c4de6c2492d5530de3f19f41d8f88ba984c2fe2