From 1205e6cff3b2df4ed8465aa1f4f4b3f8e230b7a3 Mon Sep 17 00:00:00 2001 From: jyn Date: Sun, 4 Jun 2023 21:37:09 -0500 Subject: [PATCH] Use the top-level Kind to determine whether Steps are excluded Previously, this would use the `Kind` passed to `--exclude` (and not do any filtering at all if no kind was passed). That meant that `x test linkchecker --exclude std` would fail - you had to explicitly say `--exclude test::std`. Change bootstrap to use the top-level Kind instead, which does the right thing automatically. Note that this breaks things like `x test --exclude doc::std`, but I'm not sure why you'd ever want to do that. --- src/bootstrap/CHANGELOG.md | 1 + src/bootstrap/builder.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/CHANGELOG.md b/src/bootstrap/CHANGELOG.md index d6924cf2cfb..1aba0713850 100644 --- a/src/bootstrap/CHANGELOG.md +++ b/src/bootstrap/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `x.py fmt` now formats only files modified between the merge-base of HEAD and the last commit in the master branch of the rust-lang repository and the current working directory. To restore old behaviour, use `x.py fmt .`. The check mode is not affected by this change. [#105702](https://github.com/rust-lang/rust/pull/105702) - The `llvm.version-check` config option has been removed. Older versions were never supported. If you still need to support older versions (e.g. you are applying custom patches), patch `check_llvm_version` in bootstrap to change the minimum version. [#108619](https://github.com/rust-lang/rust/pull/108619) - The `rust.ignore-git` option has been renamed to `rust.omit-git-hash`. [#110059](https://github.com/rust-lang/rust/pull/110059) +- `--exclude` no longer accepts a `Kind` as part of a Step; instead it uses the top-level Kind of the subcommand. If this matches how you were already using --exclude (e.g. `x test --exclude test::std`), simply remove the kind: `--exclude std`. If you were using a kind that did not match the top-level subcommand, please open an issue explaining why you wanted this feature. ### Non-breaking changes diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index 848fb9eade9..5bdba28158a 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -307,7 +307,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)) { + if builder.config.exclude.iter().any(|e| pathset.has(&e.path, Some(builder.kind))) { println!("Skipping {:?} because it is excluded", pathset); return true; }