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 11 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).

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
@onur-ozkan
Copy link
Member Author

I am waiting for the next beta release. Right now compiler depending on some nightly features which will be resolved with the next beta release.

@jieyouxu jieyouxu self-assigned this Mar 12, 2025
@RalfJung
Copy link
Member

That's a concern for this plan, isn't it? We'll lose the ability to immediately depend on nightly library features; we'll need to wait for a bootstrap bump. We should at least know how much we relied on that in the past to get an idea of how disruptive that will be.

@onur-ozkan
Copy link
Member Author

It is a concern yes. From what I learned (source), it happened very few times in the past.

@RalfJung
Copy link
Member

RalfJung commented Mar 12, 2025 via email

@onur-ozkan
Copy link
Member Author

What nightly API is causing the trouble right now?

This and several other functions in the same module uses ptr_sub_ptr nightly feature.

@bjorn3
Copy link
Member

bjorn3 commented Mar 12, 2025

With this PR is

COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 --test-args=--no-capture tests/{codegen-units,run-make,ui,incremental}
still enough to test the bootstrap compiler rather than build rustc and then test that rustc?

@onur-ozkan
Copy link
Member Author

With this PR is

COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 --test-args=--no-capture tests/{codegen-units,run-make,ui,incremental}

still enough to test the bootstrap compiler rather than build rustc and then test that rustc?

It will still be enough to test the bootstrap compiler; the only difference is that the stage0 library will be the beta library, not the in-tree one.

@bjorn3
Copy link
Member

bjorn3 commented Mar 12, 2025

Great! That will save some time and avoids the need to apply the standard library patches to the rust checkout too. The bootstrap compiler for me matches the rust checkout except with cg_clif as codegen backend.

@RalfJung
Copy link
Member

This and several other functions in the same module uses ptr_sub_ptr nightly feature.

Ah, that is an API that was recently renamed and then stabilized. Given that this will happen again, it seems worth ensuring that this keeps working. It should work with some cfg(bootstrap) in that code, right?

@onur-ozkan
Copy link
Member Author

It's unstable in the beta std, that's why it's not working with cfg bootstrap.

@RalfJung
Copy link
Member

That just means the compiler needs a cfg_attr(bootstrap, feature(...))?

If this does not worth with cfg bootstrap we have a problem; something like this must be supported.

@onur-ozkan
Copy link
Member Author

Actually, we can make that work with RUSTC_BOOTSTRAP, I forgot about that...

@onur-ozkan onur-ozkan force-pushed the redesign-stage0-std branch from 1d23cec to 03e695d Compare March 12, 2025 14:30
@rust-log-analyzer

This comment has been minimized.

@onur-ozkan onur-ozkan force-pushed the redesign-stage0-std branch from 03e695d to ab17250 Compare March 12, 2025 16:59
@bors
Copy link
Contributor

bors commented Mar 12, 2025

☔ The latest upstream changes (presumably #138083) made this pull request unmergeable. Please resolve the merge conflicts.

@rust-log-analyzer

This comment has been minimized.

On stage 0, rather than compiling std utilize the one from the stage0 sysroot
as stage 0 should represent the snapshot version not the compiled one.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the redesign-stage0-std branch from 0e7d963 to 03f4206 Compare March 12, 2025 18:46
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.