do not build additional stage on compiler paths by onur-ozkan · Pull Request #137882 · rust-lang/rust (original) (raw)
If I run
x build --stage 2, I don't expect a stage 3 compiler, so why should it give that when I put "compiler" next tox build? Therefore we fixedx build compiler --stage=Nto matchx build.
This is not a bug fix; it's an ad-hoc breaking change to how stage numbering works for compiler specifically.
There are arguments for and against that, but I'm concerned that nobody involved seems to understand or acknowledge that this is what's happening.
After this PR, x build and x build compiler are inconsistent in how they handle stage numbering.
The reason x build --stage=N doesn't build the stage N+1 compiler, but x build compiler --stage=N did (before this PR), is that compile::Rustc and compile::Assemble are not default steps, so x build does not include x build compiler.
(it was magically incrementing the stage, now we don't do that).
It was not magically incrementing the stage. It was using the stage N compiler, as requested, to build the compiler. The result of doing that is the stage N+1 compiler. That's why the +1 was deliberately included.
After this PR, x build compiler --stage=N now magically uses the stage N.saturating_sub(1) compiler (instead of the requested stage N) to build the stage N.saturating_sub(1) + 1 compiler. It then assembles something, though at this point the stage logic has become so ad-hoc that it's hard to tell what is being assembled or why.