force current stage when --stage is expilicitly used#118999
force current stage when --stage is expilicitly used#118999onur-ozkan wants to merge 1 commit intorust-lang:masterfrom
--stage is expilicitly used#118999Conversation
|
r? @clubby789 (rustbot has picked a reviewer for you, use r? to override) |
|
This PR modifies If appropriate, please update |
Allows users to build std with stage2 compiler without using `full-bootstrap`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2ae6025 to
dfed8af
Compare
|
Do you have any concerns on this? @Mark-Simulacrum |
|
r? Mark-Simulacrum |
| target: TargetSelection, | ||
| ) -> Compiler { | ||
| if self.build.force_use_stage2(stage) { | ||
| if self.config.explicit_stage { |
There was a problem hiding this comment.
This condition feels iffy to me as being first -- if rustbuild wants to force some stage, shouldn't we respect that? Or should this condition be made part of force_use_stage1/2?
It seems like perhaps those functions should just be no-ops with explicit stage set?
Or perhaps more/different work is warranted; it seems odd to me that --stage opts-in to behavior different than what the default is. If we think the right thing to do is to build stage 2 when it's requested on the CLI, shouldn't we do the same when it's the implicit default? (IIRC, we made a change to make stage 1 the default in most modes, so presumably this wouldn't be a change in default behavior for most people?)
There was a problem hiding this comment.
This condition feels iffy to me as being first -- if rustbuild wants to force some stage, shouldn't we respect that?
Not if the stage was explicitly requested by the user, in my opinion.
From #118233 (comment)
I don't want to compile the compiler three times. I just want the standard library built with the stage that I explicitly specified.
This seems like a very reasonable request for adding an interface that allows users to use their desired stage when they want. I am aware of that this use case is quite rare, but we should still provide a way for users to enforce their desired stage.
If we think the right thing to do is to build stage 2 when it's requested on the CLI, shouldn't we do the same when it's the implicit default?
This is very true. Maybe we should add another flag to bootstrap something like --force-stage with explaining how its different than --stage one?
There was a problem hiding this comment.
I guess the question I'm asking is why do we need force-stage separate from just stage? I.e., can we just make the behavior of adjusting the stage (--stage N or default stage N) the same?
There was a problem hiding this comment.
There are several cases where force_use_stage1/2 make sense. By default they should be enabled as they can significantly reduce the build time. But for certain cases we should also allow developers to disable/ignore them.
|
@onur-ozkan is this still relevant, or has subsequent work replaced it? I'll need to page it back into cache but I think the open comment thread is still something I haven't had my mind changed on yet... |
|
I need to check this again and see if we can improve the stage handling logic without adding @rustbot author |
|
☔ The latest upstream changes (presumably #131988) made this pull request unmergeable. Please resolve the merge conflicts. |
Allows users to build std with stage2 compiler without using
full-bootstrap.Fixes #118233
Fixes #118918