Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl PathSet {
PathSet::Set(BTreeSet::new())
}

fn one<P: Into<PathBuf>>(path: P, kind: Kind) -> PathSet {
pub fn one<P: Into<PathBuf>>(path: P, kind: Kind) -> PathSet {
let mut set = BTreeSet::new();
set.insert(TaskPath { path: path.into(), kind: Some(kind) });
PathSet::Set(set)
Expand Down Expand Up @@ -226,18 +226,7 @@ impl StepDescription {
}

fn is_excluded(&self, builder: &Builder<'_>, pathset: &PathSet) -> bool {
if builder.config.exclude.iter().any(|e| pathset.has(&e.path, e.kind)) {
eprintln!("Skipping {:?} because it is excluded", pathset);
return true;
}

if !builder.config.exclude.is_empty() {
builder.verbose(&format!(
"{:?} not skipped for {:?} -- not in {:?}",
pathset, self.name, builder.config.exclude
));
}
false
builder.is_excluded(pathset, &format!("for {:?}", self.name))
}

fn run(v: &[StepDescription], builder: &Builder<'_>, paths: &[PathBuf]) {
Expand Down Expand Up @@ -283,7 +272,7 @@ impl StepDescription {
}
}

if !attempted_run {
if !attempted_run && !builder.is_excluded(&PathSet::one(path, builder.kind), "") {
panic!("error: no rules matched {}", path.display());
}
}
Expand Down Expand Up @@ -747,6 +736,21 @@ impl<'a> Builder<'a> {
StepDescription::run(v, self, paths);
}

pub fn is_excluded(&self, pathset: &PathSet, extra_description: &str) -> bool {
if self.config.exclude.iter().any(|e| pathset.has(&e.path, e.kind)) {
eprintln!("Skipping {:?} because it is excluded", pathset);
return true;
}

if !self.config.exclude.is_empty() {
self.verbose(&format!(
"{:?} not skipped{} -- not in {:?}",
pathset, extra_description, self.config.exclude
));
}
false
}

/// Obtain a compiler at a given stage and for a given host. Explicitly does
/// not take `Compiler` since all `Compiler` instances are meant to be
/// obtained through this function, since it ensures that they are valid
Expand Down