Skip to content

Commit a517940

Browse files
committed
add "library" to RUSTC_IF_UNCHANGED_ALLOWED_PATHS
Signed-off-by: onur-ozkan <[email protected]>
1 parent 6c15503 commit a517940

File tree

2 files changed

+9
-24
lines changed

2 files changed

+9
-24
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,16 +259,10 @@ fn ci_rustc_if_unchanged_logic() {
259259
builder.run_step_descriptions(&Builder::get_step_descriptions(config.cmd.kind()), &[]);
260260

261261
// Make sure "if-unchanged" logic doesn't try to use CI rustc while there are changes
262-
// in compiler and/or library.
262+
// in "compiler" tree.
263263
if config.download_rustc_commit.is_some() {
264-
let mut paths = vec!["compiler"];
265-
266-
// Handle library tree the same way as in `Config::download_ci_rustc_commit`.
267-
if builder.config.is_running_on_ci {
268-
paths.push("library");
269-
}
270-
271-
let has_changes = config.last_modified_commit(&paths, "download-rustc", true).is_none();
264+
let has_changes =
265+
config.last_modified_commit(&["compiler"], "download-rustc", true).is_none();
272266

273267
assert!(
274268
!has_changes,

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

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ use crate::utils::helpers::{self, exe, output, t};
4444
/// final output/compiler, which can be significantly affected by changes made to the bootstrap sources.
4545
#[rustfmt::skip] // We don't want rustfmt to oneline this list
4646
pub(crate) const RUSTC_IF_UNCHANGED_ALLOWED_PATHS: &[&str] = &[
47+
":!library",
4748
":!src/tools",
4849
":!src/librustdoc",
4950
":!src/rustdoc-json-types",
@@ -3034,24 +3035,14 @@ impl Config {
30343035
}
30353036
};
30363037

3037-
// RUSTC_IF_UNCHANGED_ALLOWED_PATHS
3038-
let mut allowed_paths = RUSTC_IF_UNCHANGED_ALLOWED_PATHS.to_vec();
3039-
3040-
// In CI, disable ci-rustc if there are changes in the library tree. But for non-CI, allow
3041-
// these changes to speed up the build process for library developers. This provides consistent
3042-
// functionality for library developers between `download-rustc=true` and `download-rustc="if-unchanged"`
3043-
// options.
3044-
//
3045-
// If you update "library" logic here, update `builder::tests::ci_rustc_if_unchanged_logic` test
3046-
// logic accordingly.
3047-
if !self.is_running_on_ci {
3048-
allowed_paths.push(":!library");
3049-
}
3050-
30513038
let commit = if self.rust_info.is_managed_git_subrepository() {
30523039
// Look for a version to compare to based on the current commit.
30533040
// Only commits merged by bors will have CI artifacts.
3054-
match self.last_modified_commit(&allowed_paths, "download-rustc", if_unchanged) {
3041+
match self.last_modified_commit(
3042+
RUSTC_IF_UNCHANGED_ALLOWED_PATHS,
3043+
"download-rustc",
3044+
if_unchanged,
3045+
) {
30553046
Some(commit) => commit,
30563047
None => {
30573048
if if_unchanged {

0 commit comments

Comments
 (0)