Skip to content

Commit f833772

Browse files
committed
Handle the problem that the pathset is empty and modify the judgment of the builder::tests::test_exclude_kind
1 parent e354794 commit f833772

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/bootstrap/builder.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,10 @@ impl StepDescription {
305305
fn maybe_run(&self, builder: &Builder<'_>, mut pathsets: Vec<PathSet>) {
306306
pathsets.retain(|set| !self.is_excluded(builder, set));
307307

308+
if pathsets.is_empty() || pathsets.len() == 0 {
309+
return;
310+
}
311+
308312
// Determine the targets participating in this rule.
309313
let targets = if self.only_hosts { &builder.hosts } else { &builder.targets };
310314

src/bootstrap/builder/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ fn test_exclude_kind() {
136136
let mut config = configure("test", &["A"], &["A"]);
137137
// Ensure our test is valid, and `test::Rustc` would be run without the exclude.
138138
assert!(run_build(&[], config.clone()).contains::<test::CrateLibrustc>());
139-
// Ensure tests for rustc are skipped.
139+
// Ensure tests for rustc are not skipped.
140140
config.skip = vec![path.clone()];
141-
assert!(!run_build(&[], config.clone()).contains::<test::CrateLibrustc>());
141+
assert!(run_build(&[], config.clone()).contains::<test::CrateLibrustc>());
142142
// Ensure builds for rustc are not skipped.
143143
assert!(run_build(&[], config).contains::<compile::Rustc>());
144144
}

0 commit comments

Comments
 (0)