Skip to content

bootstrap: Split the Step trait into multiple traits#159638

Open
Zalathar wants to merge 1 commit into
rust-lang:mainfrom
Zalathar:step-split
Open

bootstrap: Split the Step trait into multiple traits#159638
Zalathar wants to merge 1 commit into
rust-lang:mainfrom
Zalathar:step-split

Conversation

@Zalathar

@Zalathar Zalathar commented Jul 21, 2026

Copy link
Copy Markdown
Member

An awkward thing about bootstrap's Step trait is that several of its implementations represent “helper tasks” that participate in bootstrap's internal caching system, but can't be explicitly selected via command-line arguments. Those tasks need to supply dummy implementations for some Step methods related to command-line processing.

This PR tries to reduce that tension by splitting the Step trait into two traits.


Steps that can be selected from the command-line implement the full CommandLineStep trait, which also provides an implementation of Step.

Helper tasks implement the smaller Step trait directly. They still participate in step-caching and step-tracing, but don't interact with command-line selectors.

r? jieyouxu

@rustbot

rustbot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

This PR changes how LLVM is built. Consider updating src/bootstrap/download-ci-llvm-stamp.

This PR changes how GCC is built. Consider updating src/bootstrap/download-ci-gcc-stamp.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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 21, 2026

@Kobzol Kobzol 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.

I'm fine with the CommandLineStep, is is very clear in what it does :)

View changes since this review

Comment thread src/bootstrap/src/core/builder/mod.rs
@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@rust-bors

This comment has been minimized.

@rustbot

This comment has been minimized.

@Zalathar

Copy link
Copy Markdown
Member Author

(Rebased over import conflicts, no changes.)

@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.

Thanks! r=me after two tiny nits
@rustbot author

View changes since this review

Comment thread src/bootstrap/src/core/builder/cli_paths.rs Outdated
Comment thread src/bootstrap/src/core/builder/mod.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 25, 2026
@rustbot

rustbot commented Jul 25, 2026

Copy link
Copy Markdown
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.

Steps that can be selected from the command-line implement the full
`CommandLineStep` trait, which also provides an implementation of `Step`.

Helper tasks implement the smaller `Step` trait directly. They still
participate in step-caching and step-tracing, but don't interact with
command-line selectors.
@Zalathar

Copy link
Copy Markdown
Member Author

Addressed nits: (diff)

@Zalathar

Copy link
Copy Markdown
Member Author

@bors r=jieyouxu

@rust-bors

rust-bors Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 7b3e992 has been approved by jieyouxu

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 100. This pull request will be tested once the tree is reopened.

Reason for tree closure: spurious failures

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 26, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 26, 2026
bootstrap: Split the `Step` trait into multiple traits

- Revised version of rust-lang#159423
- [#t-infra/bootstrap > Terminology consistency of the important concepts](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Terminology.20consistency.20of.20the.20important.20concepts/with/611795947)
- [#t-infra/bootstrap > Path filters in bootstrap](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Path.20filters.20in.20bootstrap/with/611415742)
---

An awkward thing about bootstrap's Step trait is that several of its implementations represent “helper tasks” that participate in bootstrap's internal caching system, but can't be explicitly selected via command-line arguments. Those tasks need to supply dummy implementations for some Step methods related to command-line processing.

This PR tries to reduce that tension by splitting the `Step` trait into two traits.

---

Steps that can be selected from the command-line implement the full `CommandLineStep` trait, which also provides an implementation of `Step`.

Helper tasks implement the smaller `Step` trait directly. They still participate in step-caching and step-tracing, but don't interact with command-line selectors.

r? jieyouxu
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 26, 2026
bootstrap: Split the `Step` trait into multiple traits

- Revised version of rust-lang#159423
- [#t-infra/bootstrap > Terminology consistency of the important concepts](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Terminology.20consistency.20of.20the.20important.20concepts/with/611795947)
- [#t-infra/bootstrap > Path filters in bootstrap](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Path.20filters.20in.20bootstrap/with/611415742)
---

An awkward thing about bootstrap's Step trait is that several of its implementations represent “helper tasks” that participate in bootstrap's internal caching system, but can't be explicitly selected via command-line arguments. Those tasks need to supply dummy implementations for some Step methods related to command-line processing.

This PR tries to reduce that tension by splitting the `Step` trait into two traits.

---

Steps that can be selected from the command-line implement the full `CommandLineStep` trait, which also provides an implementation of `Step`.

Helper tasks implement the smaller `Step` trait directly. They still participate in step-caching and step-tracing, but don't interact with command-line selectors.

r? jieyouxu
rust-bors Bot pushed a commit that referenced this pull request Jul 26, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #159638 (bootstrap: Split the `Step` trait into multiple traits)
 - #159774 (rustc_trait_selection: fix trait solver hang caused by degenerate obligations)
 - #159837 (line-tables-only test: check that the line number matches the function name)
 - #159946 (Update Enzyme submodule to imporve llvm-cov)
 - #159617 (Fix up `#[linkage]` target checking)
 - #159733 (std: Switch implementations of `thread_local!` for WASI)
 - #159783 (Check unsafe impls on safe EIIs)
 - #159810 (Add tuple never coercion collection regression test)
 - #159821 (Update expect message using the recommended style in binary_heap module)
 - #159826 (Remove redundant `#[rustc_paren_sugar]` feature gate)
 - #159846 (Implement `str::copy_from_str`)
 - #159849 (rustc_parse: Stop returning `Option` from statement parsing)
 - #159853 (Updated expect messages for `CString` struct and method documentation)
 - #159875 (More cleanup in `rustc_attr_parsing`)
 - #159882 (Update expect messages in library/alloc/boxed.rs and library/alloc/string.rs to follow the style guide)
 - #159891 (Split multiline derives into std/rustc macros)
 - #159893 (Fix `find_attr` hygiene and `rustc_hir` cleanups)
 - #159895 (rustc-dev-guide subtree update)
 - #159902 (Clarify that the expected runtime symbols signature is for the current target only)
 - #159914 (Fix error in diagnostic on_unmatched_args)
 - #159917 (spare capacity mut constification)
 - #159918 (rename abort_unwind → abort_on_unwind)
 - #159936 (Minor `rustc_ast::ast` doc cleanups)
 - #159945 (Update expect messages in library/core/src/ptr/non_null.rs)
rust-bors Bot pushed a commit that referenced this pull request Jul 26, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #159638 (bootstrap: Split the `Step` trait into multiple traits)
 - #159774 (rustc_trait_selection: fix trait solver hang caused by degenerate obligations)
 - #159837 (line-tables-only test: check that the line number matches the function name)
 - #159946 (Update Enzyme submodule to imporve llvm-cov)
 - #159617 (Fix up `#[linkage]` target checking)
 - #159733 (std: Switch implementations of `thread_local!` for WASI)
 - #159783 (Check unsafe impls on safe EIIs)
 - #159810 (Add tuple never coercion collection regression test)
 - #159821 (Update expect message using the recommended style in binary_heap module)
 - #159826 (Remove redundant `#[rustc_paren_sugar]` feature gate)
 - #159846 (Implement `str::copy_from_str`)
 - #159849 (rustc_parse: Stop returning `Option` from statement parsing)
 - #159853 (Updated expect messages for `CString` struct and method documentation)
 - #159875 (More cleanup in `rustc_attr_parsing`)
 - #159882 (Update expect messages in library/alloc/boxed.rs and library/alloc/string.rs to follow the style guide)
 - #159891 (Split multiline derives into std/rustc macros)
 - #159893 (Fix `find_attr` hygiene and `rustc_hir` cleanups)
 - #159895 (rustc-dev-guide subtree update)
 - #159902 (Clarify that the expected runtime symbols signature is for the current target only)
 - #159914 (Fix error in diagnostic on_unmatched_args)
 - #159917 (spare capacity mut constification)
 - #159918 (rename abort_unwind → abort_on_unwind)
 - #159936 (Minor `rustc_ast::ast` doc cleanups)
 - #159945 (Update expect messages in library/core/src/ptr/non_null.rs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testsuite Area: The testsuite used to check the correctness of rustc 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