Skip to content

Conversation

Hayden602
Copy link
Contributor

@Hayden602 Hayden602 commented Sep 12, 2025

Add the option to use the parallel compiler when building Rust code in bootstrap.

@rustbot
Copy link
Collaborator

rustbot commented Sep 12, 2025

This PR modifies bootstrap.example.toml.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@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 Sep 12, 2025
@rustbot
Copy link
Collaborator

rustbot commented Sep 12, 2025

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

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Hayden602 Hayden602 force-pushed the bootstrap branch 2 times, most recently from ebc3e15 to 7c0230f Compare September 12, 2025 07:13
@Hayden602
Copy link
Contributor Author

r? @SparrowLii @Kobzol
Hi,I’ve finished handling the issue regarding enabling parallel front end in bootstrap. Please help review if it looks appropriate. Thank you.

@rustbot rustbot assigned SparrowLii and unassigned clubby789 Sep 12, 2025
Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

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

Thanks, looks good! Could you please add an Info level entry to the change_tracker.rs file?

View changes since this review

# Trigger a `DebugBreak` after an internal compiler error during bootstrap on Windows
#rust.break-on-ice = true

# Set the number of threads used during rustc compilation
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# Set the number of threads used during rustc compilation
# Set the number of threads for the compiler frontend used during rustc compilation (passed to `-Zthreads`).

Copy link
Member

Choose a reason for hiding this comment

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

This change also isn't limited to what is "used during rustc compilation", right? Tools, std, etc will get -Zthreads as well it seems?


# Set the number of threads used during rustc compilation
# The valid options are:
# 1 - Use non-parallel compilation
Copy link
Member

Choose a reason for hiding this comment

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

that's only in the frontend, so it's not "non-parallel compilation"

@fmease fmease changed the title Add parallel-frontend-threads to bootstrap.toml and enable multi-thre… Add parallel-frontend-threads to bootstrap.toml and enable multi-threaded parallel compilation Sep 12, 2025
@Hayden602 Hayden602 force-pushed the bootstrap branch 2 times, most recently from 264a516 to b5ebe58 Compare September 15, 2025 06:23
@rustbot
Copy link
Collaborator

rustbot commented Sep 15, 2025

This PR was rebased onto a different master 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.

Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

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

As lqd said, it's not only the compilation of rustc (the compiler), but pretty much all Rust code built by bootstrap. Left three suggestions, if you accept them, and then squash the commits, I think we can go ahead and merge this :) Thanks!

View changes since this review

Comment on lines 864 to 865
# 0 - Set the number of threads according to the detected number of threads of the host system
# 0 - Set the number of threads according to the detected number of threads of the host system
Copy link
Contributor

Choose a reason for hiding this comment

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

Equal lines.

@Kobzol
Copy link
Member

Kobzol commented Sep 17, 2025

Thank you!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 17, 2025

📌 Commit 929c933 has been approved by Kobzol

It is now in the queue for this repository.

@bors bors 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 Sep 17, 2025
bors added a commit that referenced this pull request Sep 17, 2025
Rollup of 7 pull requests

Successful merges:

 - #146458 (Add parallel-frontend-threads to bootstrap.toml and enable multi-threaded parallel compilation)
 - #146485 (Remove unsized arg handling in `ArgAbiBuilderMethods::store_fn_arg` implementations)
 - #146536 (clean up several trait related UI tests)
 - #146598 (Make llvm_enzyme a regular cargo feature)
 - #146647 (Move `#[rustc_coherence_is_core]` to the `crate_level` file)
 - #146654 (Do not use `git -C dir`)
 - #146681 (Add space after brace in `Box<[T]>::new_uninit_slice` example)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0a2be63 into rust-lang:master Sep 18, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 18, 2025
rust-timer added a commit that referenced this pull request Sep 18, 2025
Rollup merge of #146458 - Hayden602:bootstrap, r=Kobzol

Add parallel-frontend-threads to bootstrap.toml and enable multi-threaded parallel compilation

Add the option to use the parallel compiler when building Rust code in bootstrap.
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.

9 participants