Skip to content

Commit 2c0cf8b

Browse files
committed
bootstrap: allow skipping steps with start of path
1 parent f2abf82 commit 2c0cf8b

File tree

1 file changed

+7
-2
lines changed
  • src/bootstrap/src/core/builder

1 file changed

+7
-2
lines changed

src/bootstrap/src/core/builder/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,17 @@ impl PathSet {
259259
// internal use only
260260
fn check(p: &TaskPath, needle: &Path, module: Kind) -> bool {
261261
if let Some(p_kind) = &p.kind {
262-
p.path.ends_with(needle) && *p_kind == module
262+
Self::check_path(p, needle) && *p_kind == module
263263
} else {
264-
p.path.ends_with(needle)
264+
Self::check_path(p, needle)
265265
}
266266
}
267267

268+
fn check_path(p: &TaskPath, needle: &Path) -> bool {
269+
// This order is important for retro-compatibility, as `starts_with` was introduced later.
270+
p.path.ends_with(needle) || p.path.starts_with(needle)
271+
}
272+
268273
/// Return all `TaskPath`s in `Self` that contain any of the `needles`, removing the
269274
/// matched needles.
270275
///

0 commit comments

Comments
 (0)