Skip to content

bootstrap: Replace ShouldRun::crates with crate_or_deps_filtered#159205

Merged
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Zalathar:crate-or-deps
Jul 13, 2026
Merged

bootstrap: Replace ShouldRun::crates with crate_or_deps_filtered#159205
rust-bors[bot] merged 3 commits into
rust-lang:mainfrom
Zalathar:crate-or-deps

Conversation

@Zalathar

Copy link
Copy Markdown
Member

This PR is a small cleanup to ShouldRun.

The ShouldRun::crates method has a comment indicating that crate_or_deps should be called instead if possible. Of the two existing callers:

  • clean_crate_tree! can easily use crate_or_deps instead.
  • compile::Rustc only needs to be able to remove a specific crate from the list of crates.

If we incorporate that filtering into an underlying crate_or_deps_filtered method, we can get rid of the crates method and its awkward do-not-use comment. Our existing snapshot tests seem to indicate that there is no behavioural change.


I'm not entirely convinced that the compile::Rustc step even needs that special behaviour, but step/dependency handling is subtle enough that I'm reluctant to remove it entirely without a better understanding of the fine details.

(The sorting change is an unrelated cleanup of some semi-related code that I happened to notice while working on the main changes.)

Zalathar added 3 commits July 13, 2026 14:23
This implementation of `should_run` was identical to `crate_or_deps`.
The only remaining direct caller of `crates` was the `compile::Rustc` step,
which wants to remove `rustc-main` from the expanded list of in-tree crates.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 13, 2026
@rustbot

rustbot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

r? @clubby789

rustbot has assigned @clubby789.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789

@jieyouxu jieyouxu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rust-bors

rust-bors Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 6b3bc86 has been approved by jieyouxu

It is now in the queue for this repository.

@rustbot rustbot assigned jieyouxu and unassigned clubby789 Jul 13, 2026
@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 13, 2026
rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
Rollup of 11 pull requests

Successful merges:

 - #159210 (`rust-analyzer` subtree update)
 - #158655 (Fix coroutine MIR saved local remapping)
 - #159205 (bootstrap: Replace `ShouldRun::crates` with `crate_or_deps_filtered`)
 - #159208 (Fix `attr_on_non_tail_expr` typo)
 - #157524 (Fix relative paths in private import suggestions)
 - #158325 (Document NonNull layout guarantees)
 - #158882 (enable `do_not_recommend` attr for method call errors in current solver)
 - #158982 (Pretty-print MIR user types too.)
 - #159069 (Add codegen test for constant returns after local use)
 - #159163 (rustc_target: Add acquire-release to implied features of v8)
 - #159201 (borrowck: Represent 'best blame constraint' as index into `Vec<OutlivesConstraint>`)
rust-bors Bot pushed a commit that referenced this pull request Jul 13, 2026
Rollup of 11 pull requests

Successful merges:

 - #159210 (`rust-analyzer` subtree update)
 - #158655 (Fix coroutine MIR saved local remapping)
 - #159205 (bootstrap: Replace `ShouldRun::crates` with `crate_or_deps_filtered`)
 - #159208 (Fix `attr_on_non_tail_expr` typo)
 - #157524 (Fix relative paths in private import suggestions)
 - #158325 (Document NonNull layout guarantees)
 - #158882 (enable `do_not_recommend` attr for method call errors in current solver)
 - #158982 (Pretty-print MIR user types too.)
 - #159069 (Add codegen test for constant returns after local use)
 - #159163 (rustc_target: Add acquire-release to implied features of v8)
 - #159201 (borrowck: Represent 'best blame constraint' as index into `Vec<OutlivesConstraint>`)
@rust-bors rust-bors Bot merged commit c6dbaaa into rust-lang:main Jul 13, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Jul 13, 2026
rust-timer added a commit that referenced this pull request Jul 13, 2026
Rollup merge of #159205 - Zalathar:crate-or-deps, r=jieyouxu

bootstrap: Replace `ShouldRun::crates` with `crate_or_deps_filtered`

This PR is a small cleanup to `ShouldRun`.

The `ShouldRun::crates` method has a comment indicating that `crate_or_deps` should be called instead if possible. Of the two existing callers:
- `clean_crate_tree!` can easily use `crate_or_deps` instead.
- `compile::Rustc` only needs to be able to remove a specific crate from the list of crates.

If we incorporate that filtering into an underlying `crate_or_deps_filtered` method, we can get rid of the `crates` method and its awkward do-not-use comment. Our existing snapshot tests seem to indicate that there is no behavioural change.

---

I'm not entirely convinced that the `compile::Rustc` step even needs that special behaviour, but step/dependency handling is subtle enough that I'm reluctant to remove it entirely without a better understanding of the fine details.

(The sorting change is an unrelated cleanup of some semi-related code that I happened to notice while working on the main changes.)
@Zalathar Zalathar deleted the crate-or-deps branch July 14, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants