-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
stabilize stage management for rustc tools #137215
Conversation
Feel free to r/? me if you want help with testing / becomes ready for review. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
90a651c
to
23999ef
Compare
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>
23999ef
to
a338439
Compare
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>
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. |
This comment was marked as off-topic.
This comment was marked as off-topic.
p.s.: Sorry for the dirty commit history. It was being painful to work on this change. |
No worries, making this less confusing is way more important |
I get it but it was buggy even for cargo and clippy that's what I'm saying. When you pass the stage flag it never works as expected (it always compiles rustc and cargo for stage +1). |
Right, so if I understand it correctly:
And I propose:
|
Yeah, we could do that. It's not hard — we just need to add a check for whether the stage was explicitly set. I can send a follow-up PR after this. |
Compile run-make-support and run-make tests with the bootstrap compiler It does not seem necessary to have to recompile run-make-support on changes to the local compiler/stdlib. This PR simplifies the implementation of a few tools, then switches rms to stage0 and also makes the handling of environment variables in run-make tests simpler. Best reviewed commit-by-commit. I can split it into multiple PRs if you want. Based on: rust-lang#137215 r? `@jieyouxu` try-job: x86_64-apple-1 try-job: x86_64-apple-2 try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: x86_64-mingw-1 try-job: x86_64-mingw-2
Compile run-make-support and run-make tests with the bootstrap compiler It does not seem necessary to have to recompile run-make-support on changes to the local compiler/stdlib. This PR simplifies the implementation of a few tools, then switches rms to stage0 and also makes the handling of environment variables in run-make tests simpler. Best reviewed commit-by-commit. I can split it into multiple PRs if you want. Based on: rust-lang#137215 r? `@jieyouxu` try-job: x86_64-apple-1 try-job: x86_64-apple-2 try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: x86_64-mingw-1 try-job: x86_64-mingw-2
Sorry for the drive by comment, but does this PR make Very sympathetic to the fact that generally setting stages for various x commands does inconsistent or confusing things though and its good to see work happen here :3 |
No, it doesn't. This PR either reduces compilation or keeps it the same as before. It doesn't add any extra compilation on any invocation. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (bb2cc59): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -7.9%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 770.304s -> 770.69s (0.05%) |
…bzol use stage 2 on cargo and clippy tests when possible Follow-up for rust-lang#137215. For more context, read the discussion starting from rust-lang#137215 (comment). r? Kobzol (Feel free to re-r if you are not available).
…bzol use stage 2 on cargo and clippy tests when possible Follow-up for rust-lang#137215. For more context, read the discussion starting from rust-lang#137215 (comment). r? Kobzol (Feel free to re-r if you are not available).
Rollup merge of rust-lang#137522 - onur-ozkan:137215-follow-ups, r=Kobzol use stage 2 on cargo and clippy tests when possible Follow-up for rust-lang#137215. For more context, read the discussion starting from rust-lang#137215 (comment). r? Kobzol (Feel free to re-r if you are not available).
@@ -8,6 +8,8 @@ incremental = true | |||
download-rustc = "if-unchanged" | |||
|
|||
[build] | |||
# cargo and clippy tests don't pass on stage 1 | |||
test-stage = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good default -- it should be considered a bug if the tests do not work in stage 1. Certainly, they do work for Miri, so this can lead to Miri contributors waiting unnecessarily long for their builds to finish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#137522 should be enough for the stage1 problems happen on clippy and cargo tests, so this should be revertable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what that does is just bump the stage to 2? I guess that hides the bugs with those tools...
I have #78717 somewhere in my TODO list, so I'll have to remember to revert that then. I don't know why cargo needs stage 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't get how #78717 is being related to test-stage = 2
in the config file.
So what that does is just bump the stage to 2? I guess that hides the bugs with those tools...
Actually I don't know if it's a bug or not. All other tools work fine but cargo and clippy fail on stage 1 tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#78717 tracks the bug that you need stage 2 for clippy. Once that is fixed, clippy can be tested on stage 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I don't know if it's a bug or not.
I am arguing that we should consider it a bug. We should have the expectation that tools can be tested in stage 1 (except when they really need the bootstrap loop to have completed, which is quite rare).
#135990 got out of control due to excessive complexity. This PR aims to achieve the same goal with a simpler approach, likely through multiple smaller PRs. I will keep the other one read-only and open as a reference for future work.
This work stabilizes the staging logic for
ToolRustc
programs, so you no longer need to handle build and target compilers separately in steps. Previously, most tools didn't do this correctly, which was causing the compiler to be built twice (e.g.,x test cargo --stage 1
would compile the stage 2 compiler before, but now it only compiles the stage 1 compiler).I also tried to document how we should write
ToolRustc
steps as they are quite different and require more attention than other tools.Next goal is to stabilize how stages are handled for the rustc itself. Currently,
x build --stage 1
builds the stage 1 compiler which is fine, butx build compiler --stage 1
builds stage 2 compiler.for now, r? ghost