Skip to content

Commit

Permalink
bootstrap: allow skipping steps with start of path
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoieni committed Nov 26, 2024
1 parent f2abf82 commit 2c0cf8b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,17 @@ impl PathSet {
// internal use only
fn check(p: &TaskPath, needle: &Path, module: Kind) -> bool {
if let Some(p_kind) = &p.kind {
p.path.ends_with(needle) && *p_kind == module
Self::check_path(p, needle) && *p_kind == module
} else {
p.path.ends_with(needle)
Self::check_path(p, needle)
}
}

fn check_path(p: &TaskPath, needle: &Path) -> bool {
// This order is important for retro-compatibility, as `starts_with` was introduced later.
p.path.ends_with(needle) || p.path.starts_with(needle)
}

/// Return all `TaskPath`s in `Self` that contain any of the `needles`, removing the
/// matched needles.
///
Expand Down

0 comments on commit 2c0cf8b

Please sign in to comment.