Skip to content
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

redesign stage 0 std #119899

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Jan 12, 2024

This is intended to update bootstrap to use the beta standard library on stage 0, rather than compiling it from source (see the motivation at rust-lang/compiler-team#619).

The only drawback encountered was the requirement of using the stage 1 compiler to build the standard library from source. This issue has been resolved by adding the --build-std-on-stage0 flag. Therefore if the goal is to only build/test the compiled standard library without spending time on compiling rustc, it can be achieved by running x build --stage 0 std --build-std-on-stage0.

Blocked on #122709

@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 Jan 12, 2024
@onur-ozkan onur-ozkan 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 Jan 12, 2024
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jan 13, 2024
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@onur-ozkan onur-ozkan force-pushed the redesign-stage0-std branch 2 times, most recently from ce81474 to b688ffa Compare January 13, 2024 15:51
@rust-log-analyzer

This comment has been minimized.

@onur-ozkan onur-ozkan force-pushed the redesign-stage0-std branch 6 times, most recently from 5f1747d to 00e59f0 Compare January 14, 2024 13:30
@onur-ozkan onur-ozkan marked this pull request as ready for review January 14, 2024 13:57
@rustbot
Copy link
Collaborator

rustbot commented Jan 14, 2024

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 onur-ozkan changed the title [WIP] redesign stage 0 std redesign stage 0 std Jan 14, 2024
@onur-ozkan
Copy link
Member Author

@rustbot ready

r? bootstrap
cc @rust-lang/libs

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 14, 2024
@onur-ozkan
Copy link
Member Author

@rustbot author (currently stage 2 std is copied from stage 1 and this behaviour should change with the beta std change)

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 14, 2024
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
#[cfg_attr(bootstrap, allow(static_mut_ref))]
#[cfg_attr(not(bootstrap), allow(static_mut_refs))]
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
Copy link
Contributor

Choose a reason for hiding this comment

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

typo nit:

Suggested change
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 18, 2024
…default, r=Mark-Simulacrum

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 3, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: aarch64-apple
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 3, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: aarch64-apple
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 3, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: aarch64-apple
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 3, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: aarch64-apple
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 6, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: aarch64-apple
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 6, 2024
…default, r=Mark-Simulacrum

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: aarch64-apple
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 6, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: test-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 6, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: test-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 13, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: test-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: test-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2024
…default, r=Mark-Simulacrum

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: test-various
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 16, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: x86_64-gnu-nopt
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: x86_64-gnu-nopt
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: x86_64-gnu-nopt
try-job: aarch64-apple
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 8, 2024
…default, r=<try>

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: x86_64-gnu-nopt
try-job: aarch64-apple
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 8, 2024
…default, r=Mark-Simulacrum

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for rust-lang#119899

try-job: x86_64-gnu-nopt
try-job: aarch64-apple
@Dylan-DPC Dylan-DPC added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 9, 2024
@Dylan-DPC
Copy link
Member

@onur-ozkan this is no longer blocked so if you can resolve the conflicts and mark it as ready for review from both github and bors pov then we can move this forward

@onur-ozkan
Copy link
Member Author

@onur-ozkan this is no longer blocked so if you can resolve the conflicts and mark it as ready for review from both github and bors pov then we can move this forward

Yeah I am aware, I will work on this soon.

@onur-ozkan onur-ozkan mentioned this pull request Oct 13, 2024
@RalfJung
Copy link
Member

RalfJung commented Oct 13, 2024

If this literally juts changes the std we use for stage 0 rustc, I think this change is highly confusing. We currently have the following bootstrap chain:
[bootstrap compiler] std (stage 0) -> compiler (stage 0) -> std (stage 1) -> compiler (stage 1)
Where every build uses the most recent compiler/library node in the chain for its own build.

Since this is a cycle, the "obvious alternative" is
[bootstrap compiler, bootstrap library] compiler (stage 0) -> std (stage 0) -> compiler (stage 1) -> std (stage 1)

Is that what this PR does? I.e., the stage 1 compiler now uses the stage 0 std? I think it should be, as that brings us back to a coherent bootstrap loop. If it just swaps the first two stages of our current loop, I am convinced this will cause no end of confusion and trouble since it will need special casing everywhere.

@joboet
Copy link
Member

joboet commented Oct 13, 2024

Is that what this PR does? I.e., the stage 1 compiler now uses the stage 0 std?

Yeah, that's the gist. Also take a look at the MCP, which has a nice diagram and also includes a proposal for using a different terminology than "stage 0".

@RalfJung
Copy link
Member

Awesome. :-)

lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Oct 17, 2024
…r=Mark-Simulacrum

use precompiled rustc for non-dist builders

Makes non-dist builders to use precompiled CI rustc by default if they are available for the target triple.

As we are going to make `rust.download-rustc=if-unchanged` default option with rust-lang/rust#119899, we need to make sure `if-unchanged` logic never breaks and works as expected.

As an addition, this will significantly improve the build times on CI when there's no change on the compiler.

blocker for #119899

try-job: x86_64-gnu-nopt
try-job: aarch64-apple
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-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.