Skip to content

Commit 55abd7f

Browse files
authored
Rollup merge of #138245 - onur-ozkan:ci-rustc-test-fix, r=jieyouxu
stabilize `ci_rustc_if_unchanged_logic` test for local environments Fixes #138239
2 parents caa2d00 + bf58a35 commit 55abd7f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/bootstrap/src/core/builder/tests.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,14 @@ fn ci_rustc_if_unchanged_logic() {
261261
// Make sure "if-unchanged" logic doesn't try to use CI rustc while there are changes
262262
// in compiler and/or library.
263263
if config.download_rustc_commit.is_some() {
264-
let has_changes =
265-
config.last_modified_commit(&["compiler", "library"], "download-rustc", true).is_none();
264+
let mut paths = vec!["compiler"];
265+
266+
// Handle library tree the same way as in `Config::download_ci_rustc_commit`.
267+
if build_helper::ci::CiEnv::is_ci() {
268+
paths.push("library");
269+
}
270+
271+
let has_changes = config.last_modified_commit(&paths, "download-rustc", true).is_none();
266272

267273
assert!(
268274
!has_changes,

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

+3
Original file line numberDiff line numberDiff line change
@@ -3018,6 +3018,9 @@ impl Config {
30183018
// these changes to speed up the build process for library developers. This provides consistent
30193019
// functionality for library developers between `download-rustc=true` and `download-rustc="if-unchanged"`
30203020
// options.
3021+
//
3022+
// If you update "library" logic here, update `builder::tests::ci_rustc_if_unchanged_logic` test
3023+
// logic accordingly.
30213024
if !CiEnv::is_ci() {
30223025
allowed_paths.push(":!library");
30233026
}

0 commit comments

Comments
 (0)