Skip to content

Commit c376c91

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

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

Diff for: 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,

Diff for: src/bootstrap/src/core/config/config.rs

+3
Original file line numberDiff line numberDiff line change
@@ -2985,6 +2985,9 @@ impl Config {
29852985
// these changes to speed up the build process for library developers. This provides consistent
29862986
// functionality for library developers between `download-rustc=true` and `download-rustc="if-unchanged"`
29872987
// options.
2988+
//
2989+
// If you update "library" logic here, update `builder::tests::ci_rustc_if_unchanged_logic` test
2990+
// logic accordingly.
29882991
if !CiEnv::is_ci() {
29892992
allowed_paths.push(":!library");
29902993
}

0 commit comments

Comments
 (0)