Skip to content

Commit f28ff13

Browse files
committed
bootstrap: Extract a separate non-CI download-rustc allowlist
1 parent 555e1d0 commit f28ff13

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

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

+16-9
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@ pub(crate) const RUSTC_IF_UNCHANGED_ALLOWED_PATHS: &[&str] = &[
5252
":!triagebot.toml",
5353
];
5454

55+
/// Additional "allowed" paths for the `download-rustc="if-unchanged"` logic
56+
/// that apply to local dev builds, but not to CI builds.
57+
///
58+
/// When modifying this list, the corresponding tests in
59+
/// `builder::tests::ci_rustc_if_unchanged_logic` should also be updated.
60+
pub(crate) const RUSTC_IF_UNCHANGED_EXTRA_ALLOWED_PATHS_OUTSIDE_CI: &[&str] = &[
61+
// tidy-alphabetical-start
62+
// In CI, disable ci-rustc if there are changes in the library tree. But for non-CI, allow
63+
// these changes to speed up the build process for library developers. This provides consistent
64+
// functionality for library developers between `download-rustc=true` and `download-rustc="if-unchanged"`
65+
// options.
66+
":!library",
67+
// tidy-alphabetical-end
68+
];
69+
5570
macro_rules! check_ci_llvm {
5671
($name:expr) => {
5772
assert!(
@@ -3180,16 +3195,8 @@ impl Config {
31803195

31813196
// RUSTC_IF_UNCHANGED_ALLOWED_PATHS
31823197
let mut allowed_paths = RUSTC_IF_UNCHANGED_ALLOWED_PATHS.to_vec();
3183-
3184-
// In CI, disable ci-rustc if there are changes in the library tree. But for non-CI, allow
3185-
// these changes to speed up the build process for library developers. This provides consistent
3186-
// functionality for library developers between `download-rustc=true` and `download-rustc="if-unchanged"`
3187-
// options.
3188-
//
3189-
// If you update "library" logic here, update `builder::tests::ci_rustc_if_unchanged_logic` test
3190-
// logic accordingly.
31913198
if !self.is_running_on_ci {
3192-
allowed_paths.push(":!library");
3199+
allowed_paths.extend_from_slice(RUSTC_IF_UNCHANGED_EXTRA_ALLOWED_PATHS_OUTSIDE_CI);
31933200
}
31943201

31953202
let commit = if self.rust_info.is_managed_git_subrepository() {

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

+1
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ fn check_rustc_if_unchanged_paths() {
459459
let config = parse("");
460460
let normalised_allowed_paths: Vec<_> = RUSTC_IF_UNCHANGED_ALLOWED_PATHS
461461
.iter()
462+
.chain(super::RUSTC_IF_UNCHANGED_EXTRA_ALLOWED_PATHS_OUTSIDE_CI)
462463
.map(|t| {
463464
t.strip_prefix(":!").expect(&format!("{t} doesn't have ':!' prefix, but it should."))
464465
})

0 commit comments

Comments
 (0)