-
Notifications
You must be signed in to change notification settings - Fork 69
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
Improve defaults in x.py #326
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed. |
I can volunteer as reviewer/mentor on the changes, but do not have bandwidth to work on building consensus around these (or determining what the right defaults are etc). |
After discussion about compile times, memory usage, and runtime performance, it seems that |
@rustbot second I'm not 100% sure whether these are the right defaults, in particular the staging question, but I think it's worth a try! |
As originally written, this MCP used imprecise numbering for the stages that didn't match the numbering used by See the Zulip thread for more discussion. |
When writing this I forgot that there are multiple x.py subcommands, and |
Improve defaults in x.py - Make the default stage dependent on the subcommand - Don't build stage1 rustc artifacts with x.py build --stage 1. If this is what you want, use x.py build --stage 2 instead, which gives you a working libstd. - Change default debuginfo when debug = true from 2 to 1 I tried to fix CI to use `--stage 2` everywhere it currently has no stage, but I might have missed a spot. This does not update much of the documentation - most of it is in https://github.com/rust-lang/rustc-dev-guide/ or https://github.com/rust-lang/rust-forge and will need a separate PR. See individual commits for a detailed rationale of each change. See also the MCP: rust-lang/compiler-team#326 r? @Mark-Simulacrum , but anyone is free to give an opinion.
Hi! Sorry, I'm late to the party. I think making stage 1 default is a good idea, but there are a couple of other things that confuse me about this change. Old behaviour
When I work on rust (mostly in our fork, which I'm regularly syncing with you folks) I wonder if I'm inadvertently doing something odd without realising. New behaviour
I don't understand the motivation for this. When I do a stage 1 build, a working rustc is the thing I care about most. That's what I need to run to see if my changes did what I expected. It's not hard to add Thanks! |
You've built two versions of the compiler. One is the 'stage 0 artifacts', which end up in
You still get a working rustc in the same place as before. It's just not doing extra work to build two versions of the compiler. |
OK, so looks like I misunderstood on both counts, so sorry for my noise. |
Proposal
Enable debug = true by defaultThis change is no longer planned.See also rust-lang/rust#73964 which is a WIP which makes the changes in bootstrap, but not in CI or in the documentation.
Make the default stage dependent on the subcommand
x.py build/test: stage 1
I've seen very few people who actually use full stage 2 builds on purpose. These compile rustc and libstd
twicethree times and don't give you much more information than a stage 1 build (except in rare cases like rust-lang/rust#68692 (comment)). For new contributors, this makes the build process even more daunting than it already is. As long as CI is changed to use--stage 2
I see no downside here.x.py bench/dist/install: stage 2
These commands have to do with a finished, optimized version of rustc. It seems very rare to want to use these with a stage 1 build.
x.py doc: stage 0
Normally when you document things you're just fixing a typo. In this case there is no need to build the whole rust compiler, since the documentation will usually be the same when generated with the beta compiler or with stage 1.
Note that for this release cycle only there will be a significant different between stage0 and stage1 docs: rust-lang/rust#73101. However most of the time this will not be the case.
Don't build stage1 rustc artifacts with x.py build --stage 1
Currently the behavior is as follows (where stageN <-> stage(N-1) artifacts, except for stage0 libstd):
x.py build --stage 0
:This leaves you without any rustc at all except for the beta compiler
(rust-lang/rust#73519). This is never what you want (currently you should use either
x.py check
orx.py build --stage 0 src/libstd
instead).x.py build --stage 1
:This leaves you with a stage1 rustc which doesn't even have
libcore and is effectively useless. Additionally, it compiles rustc
twice, which is not normally what you want.
x.py build --stage 2
:This builds the whole source tree in release mode. This is the correct usage for CI,
but takes far too long for development.
The proposed new behavior is as follows:
x.py build --stage 0
:This is suitable for contributors only working on the standard library,
as it means rustc never has to be compiled.
x.py build --stage 1
:This is suitable for contributors working on the compiler. It ensures
that you have a working rustc and libstd without having to pass
src/libstd
in addition.x.py build --stage 2
:This is suitable for debugging failures which only occur the second time rustc is built.
CI wants even more than this:
x.py build --stage 2
+ stage2 rustc. There will be a new option added to meet this use case:x.py build src/rustc
.To get the previous behavior of
x.py build --stage 1
, usex.py build --stage 2 src/libstd
, which also builds a working libstd, but does not build the release tools.--stage 2
works the same, and--stage 0
was broken anyway.Change default debuginfo when debug = true from 2 to 1
From a conversation in discord:
There is another conversation about how
debuginfo-level
is painful on Zulip.Anecdotally, this sped up my stage 1 build from 15 to 10 minutes. It still adds line numbers, it only removes variable and type information.
Enable debug = true by default
This allows contributors to get
RUST_LOG=debug
messages without havingto modify config.toml. It also enables debug assertions by default.
This change is no longer planned.
Mentors or Reviewers
I do not have a mentor in mind. I do know several people who have expressed interested in having different defaults: @eddyb, @joshtriplett, @pnkfelix, various others.
Process
The main points of the Major Change Process is as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
Comments
This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.
The text was updated successfully, but these errors were encountered: