diff options
| author | onur-ozkan <work@onurozkan.dev> | 2025-03-09 01:36:51 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2025-03-10 18:10:56 +0300 |
| commit | bf58a3521f8e5fb0fa693e77ce9ef7e5e3c4a915 (patch) | |
| tree | 09ba76e37d1eeaf6c6896386ddb630c846f627f9 | |
| parent | efea9896f506baa08f40444e07774e827646d57a (diff) | |
| download | rust-bf58a3521f8e5fb0fa693e77ce9ef7e5e3c4a915.tar.gz rust-bf58a3521f8e5fb0fa693e77ce9ef7e5e3c4a915.zip | |
stabilize `ci_rustc_if_unchanged_logic` test for local environments
Signed-off-by: onur-ozkan <work@onurozkan.dev>
| -rw-r--r-- | src/bootstrap/src/core/builder/tests.rs | 10 | ||||
| -rw-r--r-- | src/bootstrap/src/core/config/config.rs | 3 |
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 63a1bbc24f1..1f96ac729e2 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 ac24da9f86b..09dc9dfbc04 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -2985,6 +2985,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"); } |
