bootstrap: Overhaul matching of command-line selectors to steps - #160961
Merged
Conversation
Collaborator
|
r? @jieyouxu rustbot has assigned @jieyouxu. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
Member
Author
This is a clippy false-positive. Replacing the map-clone with
|
Kobzol
reviewed
Aug 12, 2026
Member
|
Thanks. You can r=me once PR CI is green. |
Member
Author
|
This comment has been minimized.
This comment has been minimized.
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Member
Author
|
Rebased with only trivial changes. I'll wait for PR CI before reapproving. |
Member
Author
|
@bors r=Kobzol |
Contributor
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 13, 2026
Rollup of 8 pull requests Successful merges: - #159593 (merge ambiguity errors that blame the same inference variable) - #160687 (Experiment: Add `core::cmp::smallest` and `core::cmp::largest`) - #160856 (Replace infers and non-rigid aliases with `Ty/Const::Error` if param env normalization fails) - #160961 (bootstrap: Overhaul matching of command-line selectors to steps) - #160975 (Remove target argument from get_proc_macros) - #161023 (bootstrap: Replace the `exit!` macro with a function `helpers::exit_process`) - #160932 (Make tidy::Version public) - #161029 (mailmap: Update my default email)
rust-timer
added a commit
that referenced
this pull request
Aug 13, 2026
Rollup merge of #160961 - Zalathar:selectors, r=Kobzol bootstrap: Overhaul matching of command-line selectors to steps The existing bootstrap code for matching command-line selectors (paths) to steps has to jump through hoops to reconstruct the relative order of command-line arguments, and to keep track of which selectors didn't end up matching any steps. It also makes an awkward distinction between test-suite paths and other kinds of path/alias. We can simplify the matching process by iterating over the command-line selectors in an outer loop, and retaining that ordering in the resulting collection of work items as much as possible. Specifically, we keep an ordered list of steps to run, and an ordered list of selected anchors to pass to each step. After deduplicating those lists, the resulting run order is mostly consistent with command-line order, while batching each step's work as much as possible. --- This new implementation should give *mostly* the same outcomes as the previous implementation, with a few known differences: - The order of selected anchors passed to each step is *more* consistent with command-line order in some cases (e.g. see the core+alloc+stdarch snapshot test). - Test-suite paths are no longer processed in a separate earlier pass, so invocations like `./x test compiler ui` will now run the compiler-crate unit tests before the UI tests. - If multiple test paths are passed for the same test suite, snapshot tests no longer see multiple invocations of the underlying test step. (Step-caching would already prevent the duplicate invocations from actually running.) --- There are further tweaks or enhancements that could be made, but I decided to stop here to stick to preserve existing behaviour as much as possible, outside of the differences that naturally fall out of the simpler implementation.
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 14, 2026
Overhaul matching of command-line selectors to steps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing bootstrap code for matching command-line selectors (paths) to steps has to jump through hoops to reconstruct the relative order of command-line arguments, and to keep track of which selectors didn't end up matching any steps. It also makes an awkward distinction between test-suite paths and other kinds of path/alias.
We can simplify the matching process by iterating over the command-line selectors in an outer loop, and retaining that ordering in the resulting collection of work items as much as possible.
Specifically, we keep an ordered list of steps to run, and an ordered list of selected anchors to pass to each step. After deduplicating those lists, the resulting run order is mostly consistent with command-line order, while batching each step's work as much as possible.
This new implementation should give mostly the same outcomes as the previous implementation, with a few known differences:
./x test compiler uiwill now run the compiler-crate unit tests before the UI tests.There are further tweaks or enhancements that could be made, but I decided to stop here to stick to preserve existing behaviour as much as possible, outside of the differences that naturally fall out of the simpler implementation.