about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-03-11 19:35:31 +0100
committerGitHub <noreply@github.com>2025-03-11 19:35:31 +0100
commit55abd7fc82d84539912ebf7c28b2ad266d7b6a7f (patch)
tree69876fbe0ea6afdd5ea4df61f68ce9ccb047890b
parentcaa2d008f9f4f579fa54634f94bc0e5bf447215e (diff)
parentbf58a3521f8e5fb0fa693e77ce9ef7e5e3c4a915 (diff)
downloadrust-55abd7fc82d84539912ebf7c28b2ad266d7b6a7f.tar.gz
rust-55abd7fc82d84539912ebf7c28b2ad266d7b6a7f.zip
Rollup merge of #138245 - onur-ozkan:ci-rustc-test-fix, r=jieyouxu
stabilize `ci_rustc_if_unchanged_logic` test for local environments

Fixes #138239
-rw-r--r--src/bootstrap/src/core/builder/tests.rs10
-rw-r--r--src/bootstrap/src/core/config/config.rs3
2 files changed, 11 insertions, 2 deletions
diff --git a/src/bootstrap/src/core/builder/tests.rs b/src/bootstrap/src/core/builder/tests.rs
index e8820e3a828..b062781e68a 100644
--- a/src/bootstrap/src/core/builder/tests.rs
+++ b/src/bootstrap/src/core/builder/tests.rs
@@ -261,8 +261,14 @@ fn ci_rustc_if_unchanged_logic() {
     // Make sure "if-unchanged" logic doesn't try to use CI rustc while there are changes
     // in compiler and/or library.
     if config.download_rustc_commit.is_some() {
-        let has_changes =
-            config.last_modified_commit(&["compiler", "library"], "download-rustc", true).is_none();
+        let mut paths = vec!["compiler"];
+
+        // Handle library tree the same way as in `Config::download_ci_rustc_commit`.
+        if build_helper::ci::CiEnv::is_ci() {
+            paths.push("library");
+        }
+
+        let has_changes = config.last_modified_commit(&paths, "download-rustc", true).is_none();
 
         assert!(
             !has_changes,
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index e73659773ab..a07c40bdc83 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -3018,6 +3018,9 @@ impl Config {
         // these changes to speed up the build process for library developers. This provides consistent
         // functionality for library developers between `download-rustc=true` and `download-rustc="if-unchanged"`
         // options.
+        //
+        // If you update "library" logic here, update `builder::tests::ci_rustc_if_unchanged_logic` test
+        // logic accordingly.
         if !CiEnv::is_ci() {
             allowed_paths.push(":!library");
         }