-
Notifications
You must be signed in to change notification settings - Fork 514
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
[WIP] Fix and clean up the terminology for stages #807
Conversation
- Use 'stage0 rustc' and 'stage0 compiler' to mean `stage0-rustc` - Use 'bootstrap' to mean `build/$target/stage0` (i.e. the beta compiler) - Mention that 'ignore-stage1' means 'ignore programs linked to stage1', not built by it.
sigh We should rename
I think "stageN rustc", and even more so "stageN compiler" is ambiguous and ideally we would never use it in documentation. It could mean one of two things:
This probably is fine, i.e. referring to "bootstrap compiler" and explaining it's one of these:
Isn't it simpler to say "tests ran at stage 1" , meaning as part of We never use "built by stage N" to mean "compiled by |
FWIW it's called rustbuild on the tags for rust-lang/rust: https://github.com/rust-lang/rust/labels/A-rustbuild
What could I say instead? I need to refer to 'the rustc that's part of stageN' somehow :/
Good idea, I'll add that since it gives an easy shorthand. I think the point about linking is helpful for understanding it though.
Whoops, I thought I said 'stage N compiler' everywhere but it turns out I just said 'stage N' in the What would you consider disambiguating? I'm all for making things more clear but I'm not sure how to do that here. |
@@ -78,6 +78,47 @@ contribution [here][bootstrap-build]. | |||
|
|||
## Stages of bootstrap | |||
|
|||
Like most other bootstrapping compilers, `rustc` is compiled in stages. | |||
_Unlike_ most other compilers, where `stage0` refers to the bootstrap compiler, |
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.
This is .. well, not quite true. stage0/bin/rustc is the bootstrap compiler. Really, we should rename it, but "to what?" then the question is.
_Unlike_ most other compilers, where `stage0` refers to the bootstrap compiler, | ||
`stage0` refers to the first compiler built by bootstrap. So the following command: | ||
|
||
```sh | ||
x.py build --stage 0 src/rustc | ||
``` |
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.
fwiw, I feel like this doesn't seem correct. I call the stage0 compiler the beta compiler which appears in the stage0
directory which is used during stage0. It creates artifacts in the stage0-* directories, which during stage1 uses Assemble
to create the stage1 compiler. There's a phrase in the bootstrapping guide (which I may have written) which I think sums it up succinctly:
Stage 0 uses the stage0 compiler to create stage0 artifacts which will later be uplifted to stage1.
It seems to me a lot of confusion stems from the --stage
command-line flag, and that the terminology for "the stage" and "the compiler used in the stage" and "the compiler created by the stage" are all sort of the same. Another problem I think is that a stage's output is written to directories with the same stage, but not actually used from there (they get copied out into stageN+1), so it straddles the boundary. Also, people have different preconceived notions, and the numbering often seems off-by-one (rust-lang/rust#57963 and rust-lang/rust#59864). But just changing that in the documentation I think will make things worse.
Ok, it's clear that this hurts more than it helps. How about the following scheme?
I'm not sure how we should describe |
I'm going to make a separate PR for this since I expect it to be uncontroversial. |
Ok, we discussed this extensively in today's meeting, and I think I'm now more on board with renaming the stages... We also created this graphic: diagram.pdf |
Note that what we discussed was moving |
Ah, I didn't read carefully. |
Closing this since it doesn't reflect the changes I want to make. Hopefully someone gets a chance to make a PR for #807 (comment) soon :) |
This PR does not affect behavior around stages in any way. Instead, it adds aliases for `--stage` which represent how the stage is interpreted by bootstrap. See rust-lang/rustc-dev-guide#807 (comment) and https://rust-lang.zulipchat.com/#narrow/stream/196385-t-compiler.2Fwg-rustc-dev-guide/topic/meeting.2008.2E04.2E2020 for more discussion.
rustbuild
instead of saying 'the bootstrap binary'stage0-rustc
build/$target/stage0
(i.e. the beta compiler)not built by it.
r? @eddyb