Skip to content

Commit dcb4659

Browse files
Rollup merge of #115088 - LuuuXXX:issue-112009, r=albertlarsan68
Fix Step Skipping Caused by Using the `--exclude` Option The original code was overreacting to the `--exclude` option, https://github.com/rust-lang/rust/blob/eadf69a6c6edfe220fc5b1b659e46e271d75a3a1/src/bootstrap/builder.rs#L257-L260 For example: When `x test --exclude alloc` or `x test --exclude library/alloc` is passed, the entire libraray test is skipped. Related issues: #112009
2 parents 2cceedd + 45abd8c commit dcb4659

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/bootstrap/builder.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,10 @@ impl StepDescription {
302302
}
303303
}
304304

305-
fn maybe_run(&self, builder: &Builder<'_>, pathsets: Vec<PathSet>) {
306-
if pathsets.iter().any(|set| self.is_excluded(builder, set)) {
305+
fn maybe_run(&self, builder: &Builder<'_>, mut pathsets: Vec<PathSet>) {
306+
pathsets.retain(|set| !self.is_excluded(builder, set));
307+
308+
if pathsets.is_empty() {
307309
return;
308310
}
309311

src/bootstrap/builder/tests.rs

+2-2
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
}

src/ci/docker/host-x86_64/wasm32/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@ ENV NO_CHANGE_USER=1
5858
RUN chown 10719 -R /emsdk-portable/
5959

6060
# Exclude library/alloc due to OOM in benches.
61+
# FIXME: Fix std tests
6162
ENV SCRIPT python3 ../x.py test --stage 2 --host='' --target $TARGETS \
62-
--skip library/alloc
63+
--skip library/alloc --skip library/std

0 commit comments

Comments
 (0)