Skip to content

implement new x flag: --skip-std-check-if-no-download-rustc #141970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 5, 2025

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Jun 3, 2025

One of our developers (@RalfJung) reported#t-infra/bootstrap > Surprising stages for check build after stage reorg that working on both the compiler and the library simultaneously with RA enabled is extremely difficult because checking library creates a heavy load on machines (by building stage1 compiler) on each modification. --skip-std-check-if-no-download-rustc flag is intended to reduce this heavy load on their IDE integration as much as possible.

Fixes: #141955

@rustbot
Copy link
Collaborator

rustbot commented Jun 3, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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

@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 Jun 3, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 3, 2025

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

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

@onur-ozkan
Copy link
Member Author

r? Kobzol (since you were part of the discussion on Zulip)

@rustbot rustbot assigned Kobzol and unassigned Mark-Simulacrum Jun 3, 2025
Signed-off-by: onur-ozkan <[email protected]>
Signed-off-by: onur-ozkan <[email protected]>
@RalfJung
Copy link
Member

RalfJung commented Jun 3, 2025

Related: #141955

@@ -60,6 +60,13 @@ impl Step for Std {
}

fn run(self, builder: &Builder<'_>) {
if !builder.download_rustc() && builder.config.skip_std_check_if_no_download_rustc {
Copy link
Member

Choose a reason for hiding this comment

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

Does this take into account the "if-unchanged" logic?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it does.

@RalfJung
Copy link
Member

RalfJung commented Jun 3, 2025

Thanks a lot for looking into this :-)

Copy link
Contributor

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

LGTM modulo the documentation nit.

@rustbot rustbot added the A-rustc-dev-guide Area: rustc-dev-guide label Jun 4, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jun 4, 2025

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol

Comment on lines +62 to +68
### Checking the "library" tree

Checking the "library" tree requires a stage1 compiler, which can be a heavy process on some computers.
For this reason, bootstrap has a flag called `--skip-std-check-if-no-download-rustc` that skips checking the
"library" tree if `rust.download-rustc` isn't available. If you want to avoid putting a heavy load on your computer
with `rust-analyzer`, you can add the `--skip-std-check-if-no-download-rustc` flag to your `./x check` command in
the `rust-analyzer` configuration.
Copy link
Member Author

Choose a reason for hiding this comment

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

There are too many sample RA configurations. I decided to document this flag separately by its own and leave it to users to decide whether or not to utilize it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, fair enough. The main point to get across is that this is only useful when you want to check multiple things (x check compiler library). Otherwise if you check only the library you will always require stage 1.

@Kobzol
Copy link
Contributor

Kobzol commented Jun 4, 2025

You can r=me once CI is green.

@onur-ozkan
Copy link
Member Author

@bors r=Kobzol

@bors
Copy link
Collaborator

bors commented Jun 4, 2025

📌 Commit c843bec 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 Jun 4, 2025
@onur-ozkan
Copy link
Member Author

@bors rollup

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 5, 2025
implement new `x` flag: `--skip-std-check-if-no-download-rustc`

One of our developers (`@RalfJung)` [reported](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606)[#t-infra/bootstrap > Surprising stages for check build after stage reorg](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606) that working on both the compiler and the library simultaneously with RA enabled is extremely difficult because checking library creates a heavy load on machines (by building stage1 compiler) on each modification. `--skip-std-check-if-no-download-rustc` flag is intended to reduce this heavy load on their IDE integration as much as possible.

Fixes: rust-lang#141955
bors added a commit that referenced this pull request Jun 5, 2025
Rollup of 8 pull requests

Successful merges:

 - #140638 (UnsafePinned: also include the effects of UnsafeCell)
 - #141272 (modularize the config module bootstrap)
 - #141777 (Do not run PGO/BOLT in x64 Linux alt builds)
 - #141870 (Fix broken link to rustc_type_ir module in serialization docs)
 - #141938 (update rust offload bootstrap)
 - #141962 (rustc-dev-guide subtree update)
 - #141965 (`tests/ui`: A New Order [3/N])
 - #141970 (implement new `x` flag: `--skip-std-check-if-no-download-rustc`)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jun 5, 2025
Rollup of 6 pull requests

Successful merges:

 - #140638 (UnsafePinned: also include the effects of UnsafeCell)
 - #141777 (Do not run PGO/BOLT in x64 Linux alt builds)
 - #141938 (update rust offload bootstrap)
 - #141962 (rustc-dev-guide subtree update)
 - #141965 (`tests/ui`: A New Order [3/N])
 - #141970 (implement new `x` flag: `--skip-std-check-if-no-download-rustc`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit cfe78d9 into rust-lang:master Jun 5, 2025
10 checks passed
rust-timer added a commit that referenced this pull request Jun 5, 2025
Rollup merge of #141970 - onur-ozkan:skip-stage1-std, r=Kobzol

implement new `x` flag: `--skip-std-check-if-no-download-rustc`

One of our developers (``@RalfJung)`` [reported](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606)[#t-infra/bootstrap > Surprising stages for check build after stage reorg](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Surprising.20stages.20for.20check.20build.20after.20stage.20reorg/with/521925606) that working on both the compiler and the library simultaneously with RA enabled is extremely difficult because checking library creates a heavy load on machines (by building stage1 compiler) on each modification. `--skip-std-check-if-no-download-rustc` flag is intended to reduce this heavy load on their IDE integration as much as possible.

Fixes: #141955
@rustbot rustbot added this to the 1.89.0 milestone Jun 5, 2025
@onur-ozkan onur-ozkan deleted the skip-stage1-std branch June 5, 2025 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustc-dev-guide Area: rustc-dev-guide 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.

Suggested workflow for vscode check-on-save can lead to surprisingly expensive check builds
6 participants