Skip to content
/ rust Public
forked from rust-lang/rust

Commit 0b16456

Browse files
committed
fix(bootstrap): rename exclude flag to skip 🐛
1 parent 8236f63 commit 0b16456

File tree

17 files changed

+130
-47
lines changed

17 files changed

+130
-47
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ jobs:
336336
os: macos-13
337337
- name: x86_64-apple-1
338338
env:
339-
SCRIPT: "./x.py --stage 2 test --exclude tests/ui --exclude tests/rustdoc --exclude tests/run-make-fulldeps"
339+
SCRIPT: "./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc --skip tests/run-make-fulldeps"
340340
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
341341
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
342342
MACOSX_DEPLOYMENT_TARGET: 10.8

src/bootstrap/builder.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -317,19 +317,17 @@ impl StepDescription {
317317
}
318318

319319
fn is_excluded(&self, builder: &Builder<'_>, pathset: &PathSet) -> bool {
320-
if builder.config.exclude.iter().any(|e| pathset.has(&e, builder.kind)) {
320+
if builder.config.skip.iter().any(|e| pathset.has(&e, builder.kind)) {
321321
if !matches!(builder.config.dry_run, DryRun::SelfCheck) {
322322
println!("Skipping {pathset:?} because it is excluded");
323323
}
324324
return true;
325325
}
326326

327-
if !builder.config.exclude.is_empty()
328-
&& !matches!(builder.config.dry_run, DryRun::SelfCheck)
329-
{
327+
if !builder.config.skip.is_empty() && !matches!(builder.config.dry_run, DryRun::SelfCheck) {
330328
builder.verbose(&format!(
331329
"{:?} not skipped for {:?} -- not in {:?}",
332-
pathset, self.name, builder.config.exclude
330+
pathset, self.name, builder.config.skip
333331
));
334332
}
335333
false
@@ -2129,7 +2127,7 @@ impl<'a> Builder<'a> {
21292127
let desc = StepDescription::from::<S>(kind);
21302128
let should_run = (desc.should_run)(ShouldRun::new(self, desc.kind));
21312129

2132-
// Avoid running steps contained in --exclude
2130+
// Avoid running steps contained in --skip
21332131
for pathset in &should_run.paths {
21342132
if desc.is_excluded(self, pathset) {
21352133
return None;

src/bootstrap/builder/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ fn test_intersection() {
119119
#[test]
120120
fn test_exclude() {
121121
let mut config = configure("test", &["A"], &["A"]);
122-
config.exclude = vec!["src/tools/tidy".into()];
122+
config.skip = vec!["src/tools/tidy".into()];
123123
let cache = run_build(&[], config);
124124

125125
// Ensure we have really excluded tidy
@@ -137,7 +137,7 @@ fn test_exclude_kind() {
137137
// Ensure our test is valid, and `test::Rustc` would be run without the exclude.
138138
assert!(run_build(&[], config.clone()).contains::<test::CrateLibrustc>());
139139
// Ensure tests for rustc are skipped.
140-
config.exclude = vec![path.clone()];
140+
config.skip = vec![path.clone()];
141141
assert!(!run_build(&[], config.clone()).contains::<test::CrateLibrustc>());
142142
// Ensure builds for rustc are not skipped.
143143
assert!(run_build(&[], config).contains::<compile::Rustc>());

src/bootstrap/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub struct Config {
130130
pub sanitizers: bool,
131131
pub profiler: bool,
132132
pub omit_git_hash: bool,
133-
pub exclude: Vec<PathBuf>,
133+
pub skip: Vec<PathBuf>,
134134
pub include_default_paths: bool,
135135
pub rustc_error_format: Option<String>,
136136
pub json_output: bool,
@@ -1112,7 +1112,7 @@ impl Config {
11121112

11131113
// Set flags.
11141114
config.paths = std::mem::take(&mut flags.paths);
1115-
config.exclude = flags.exclude;
1115+
config.skip = flags.skip.into_iter().chain(flags.exclude).collect();
11161116
config.include_default_paths = flags.include_default_paths;
11171117
config.rustc_error_format = flags.rustc_error_format;
11181118
config.json_output = flags.json_output;

src/bootstrap/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ fn doc_std(
570570
if builder.no_std(target) == Some(true) {
571571
panic!(
572572
"building std documentation for no_std target {target} is not supported\n\
573-
Set `docs = false` in the config to disable documentation, or pass `--exclude doc::library`."
573+
Set `docs = false` in the config to disable documentation, or pass `--skip library`."
574574
);
575575
}
576576

src/bootstrap/flags.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ pub struct Flags {
6868

6969
#[arg(global(true), long, value_name = "PATH")]
7070
/// build paths to exclude
71-
pub exclude: Vec<PathBuf>,
71+
pub exclude: Vec<PathBuf>, // keeping for client backward compatibility
72+
#[arg(global(true), long, value_name = "PATH")]
73+
/// build paths to skip
74+
pub skip: Vec<PathBuf>,
7275
#[arg(global(true), long)]
7376
/// include default paths in addition to the provided ones
7477
pub include_default_paths: bool,
@@ -318,7 +321,7 @@ pub enum Subcommand {
318321
no_fail_fast: bool,
319322
#[arg(long, value_name = "SUBSTRING")]
320323
/// skips tests matching SUBSTRING, if supported by test tool. May be passed multiple times
321-
skip: Vec<String>,
324+
skip: Vec<PathBuf>,
322325
#[arg(long, value_name = "ARGS", allow_hyphen_values(true))]
323326
/// extra arguments to be passed for the test tool being used
324327
/// (e.g. libtest, compiletest or rustdoc)

src/bootstrap/mk/Makefile.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ prepare:
6363
ci-msvc-py:
6464
$(Q)$(CFG_SRC_DIR)/x.py test --stage 2 tidy
6565
ci-msvc-ps1:
66-
$(Q)$(CFG_SRC_DIR)/x.ps1 test --stage 2 --exclude tidy
66+
$(Q)$(CFG_SRC_DIR)/x.ps1 test --stage 2 --skip tidy
6767
ci-msvc: ci-msvc-py ci-msvc-ps1
6868

6969
## MingW native builders
@@ -72,7 +72,7 @@ ci-msvc: ci-msvc-py ci-msvc-ps1
7272
ci-mingw-x:
7373
$(Q)$(CFG_SRC_DIR)/x test --stage 2 tidy
7474
ci-mingw-bootstrap:
75-
$(Q)$(BOOTSTRAP) test --stage 2 --exclude tidy
75+
$(Q)$(BOOTSTRAP) test --stage 2 --skip tidy
7676
ci-mingw: ci-mingw-x ci-mingw-bootstrap
7777

7878
.PHONY: dist

src/bootstrap/test.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl Step for Linkcheck {
122122
if (hosts != targets) && !hosts.is_empty() && !targets.is_empty() {
123123
panic!(
124124
"Linkcheck currently does not support builds with different hosts and targets.
125-
You can skip linkcheck with --exclude src/tools/linkchecker"
125+
You can skip linkcheck with --skip src/tools/linkchecker"
126126
);
127127
}
128128

@@ -1104,7 +1104,7 @@ impl Step for Tidy {
11041104
error: no `rustfmt` binary found in {PATH}
11051105
info: `rust.channel` is currently set to \"{CHAN}\"
11061106
help: if you are testing a beta branch, set `rust.channel` to \"beta\" in the `config.toml` file
1107-
help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy` to `x.py test`",
1107+
help: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to `x.py test`",
11081108
PATH = inferred_rustfmt_dir.display(),
11091109
CHAN = builder.config.channel,
11101110
);
@@ -1650,7 +1650,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
16501650
cmd.arg("--run-clang-based-tests-with").arg(clang_exe);
16511651
}
16521652

1653-
for exclude in &builder.config.exclude {
1653+
for exclude in &builder.config.skip {
16541654
cmd.arg("--skip");
16551655
cmd.arg(&exclude);
16561656
}

src/ci/docker/host-x86_64/i686-gnu/Dockerfile

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ COPY scripts/sccache.sh /scripts/
2424
RUN sh /scripts/sccache.sh
2525

2626
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
27-
# Exclude some tests that are unlikely to be platform specific, to speed up
27+
# Skip some tests that are unlikely to be platform specific, to speed up
2828
# this slow job.
2929
ENV SCRIPT python3 ../x.py --stage 2 test \
30-
--exclude src/bootstrap \
31-
--exclude tests/rustdoc-js \
32-
--exclude src/tools/error_index_generator \
33-
--exclude src/tools/linkchecker
30+
--skip src/bootstrap \
31+
--skip tests/rustdoc-js \
32+
--skip src/tools/error_index_generator \
33+
--skip src/tools/linkchecker

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ RUN chown 10719 -R /emsdk-portable/
5959

6060
# Exclude library/alloc due to OOM in benches.
6161
ENV SCRIPT python3 ../x.py test --stage 2 --host='' --target $TARGETS \
62-
--exclude library/alloc
62+
--skip library/alloc

src/ci/docker/host-x86_64/x86_64-gnu-llvm-15/script.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -ex
44

55
# Only run the stage 1 tests on merges, not on PR CI jobs.
66
if [[ -z "${PR_CI_JOB}" ]]; then
7-
../x.py --stage 1 test --exclude src/tools/tidy && \
7+
../x.py --stage 1 test --skip src/tools/tidy && \
88
# Run the `mir-opt` tests again but this time for a 32-bit target.
99
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
1010
# both 32-bit and 64-bit outputs updated by the PR author, before
@@ -16,7 +16,7 @@ if [[ -z "${PR_CI_JOB}" ]]; then
1616
fi
1717

1818
# NOTE: intentionally uses all of `x.py`, `x`, and `x.ps1` to make sure they all work on Linux.
19-
../x.py --stage 2 test --exclude src/tools/tidy && \
19+
../x.py --stage 2 test --skip src/tools/tidy && \
2020
# Run the `mir-opt` tests again but this time for a 32-bit target.
2121
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
2222
# both 32-bit and 64-bit outputs updated by the PR author, before

src/ci/github-actions/ci.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
# step CI will fail.
1515

1616
---
17-
1817
###############################
1918
# YAML Anchors Definition #
2019
###############################
@@ -30,7 +29,6 @@
3029
# The expand-yaml-anchors tool will automatically remove this block from the
3130
# output YAML file.
3231
x--expand-yaml-anchors--remove:
33-
3432
- &shared-ci-variables
3533
CI_JOB_NAME: ${{ matrix.name }}
3634
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
@@ -520,7 +518,7 @@ jobs:
520518

521519
- name: x86_64-apple-1
522520
env: &env-x86_64-apple-tests
523-
SCRIPT: ./x.py --stage 2 test --exclude tests/ui --exclude tests/rustdoc --exclude tests/run-make-fulldeps
521+
SCRIPT: ./x.py --stage 2 test --skip tests/ui --skip tests/rustdoc --skip tests/run-make-fulldeps
524522
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
525523
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
526524
MACOSX_DEPLOYMENT_TARGET: 10.8

0 commit comments

Comments
 (0)