-
Notifications
You must be signed in to change notification settings - Fork 520
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
Explain stages in terms of the compiler currently running (take N+1) #857
Conversation
8f6887e
to
6a57ac4
Compare
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.
A couple minor typographical nits :)
This comment has been minimized.
This comment has been minimized.
FWIW I know this as the @eddyb view of bootstrapping, which they explained https://github.com/rust-lang/rust/issues/59864.^^ |
Also should this be marked as closing rust-lang/rust#57963 ? |
I'd like to hear the opinion of some of the people from that issue first I think. It doesn't help to say "it's documented" if no one understands it. |
b5ac6db
to
27b763f
Compare
Pinging a random person who's involved with bootstrapping: r? @ehuss |
dffcb06
to
f799b3d
Compare
ping @Mark-Simulacrum - I know you have trouble explaining staging, but could you double check the information is accurate? |
a3119d6
to
4247800
Compare
I'm pretty happy with how this is now - does anyone want to take another look? If not I think this is ready to merge :) |
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.
Looks good! Here are a few nits
It looks like CI is failing again because of a billion 429 Too Many Request errors :( It would be really nice if we could ignore those. |
abcd2bc
to
5d3ce76
Compare
- Address some confusing points + stage N+1 -> stage N artifacts + Use more likely examples of an ABI break + stage N -> stage N compiler - Mention why rustc occasionally uses `cfg(bootstrap)` - Note that stage1 is built using two different versions - Add lots of examples + `test src/test/ui` and `test compiler/rustc` run different compilers 😢 + Separate examples of what to do from examples of what not to do - 'ship stage 1 artifacts' -> 'ship stage 2 compiler' This is hopefully less confusing.
9626f03
to
8363e2a
Compare
- The "stage (N+1) compiler" is assembled from "stage N artifacts". This | ||
process is called _uplifting_. |
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.
What do you mean when you say "assembled"?
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 am not actually sure ... @Mark-Simulacrum what does Assemble
actually do? It can't just be copying files because I tried running the binary in stage0-rustc and it gave an error about shared objects:
build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/rustc-main: error while loading shared libraries: librustc_driver-3b0ece280f85df92.so: cannot open shared object file: No such file or directory
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 build artifacts section does clear up some things for me, so thanks!
Co-authored-by: Camelid <37223377+camelid@users.noreply.github.com>
library/std` instead, which puts the compiler in `stage1/rustc`. | ||
|
||
[#73519]: https://github.com/rust-lang/rust/issues/73519 | ||
|
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.
What about having a table like this? (Correct me if I got things mixed up; it's confusing :) )
I think this will help clear things up for people (me).
Stage | Flag for building this stage | Flag for running this stage | Output directory | What it's used for |
---|---|---|---|---|
stage 0 | N/A | --stage 0 |
N/A | This is a recent beta version of rustc, equivalent to rustc +beta ... |
stage 1 | --stage 1 |
--stage 1 |
build/<toolchain>/stage1 |
Usually you want to build this when working on Rust |
stage 2 | --stage 2 |
--stage 2 |
build<toolchain>/stage2 |
This is what's released to rustup; you probably don't want to build this when working on Rust |
### Stages | |
| Stage | Flag for _building_ this stage | Flag for _running_ this stage | Output directory | What it's used for | | |
| --- | --- | --- | --- | --- | | |
| stage 0 | N/A | `--stage 0` | N/A | This is a recent beta version of rustc, equivalent to `rustc +beta ...` | | |
| stage 1 | `--stage 1` | `--stage 1` | `build/<toolchain>/stage1` | Usually you want to build this when working on Rust | | |
| stage 2 | `--stage 2` | `--stage 2` | `build<toolchain>/stage2` | This is what's released to rustup; you probably don't want to build this when working on Rust | | |
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.
Heh, this is basically #843. Let's hold off on that for now.
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.
Alright, maybe I'll open a follow-up PR then :)
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.
Also it's not entirely correct, test --stage 1 src/test/ui
runs the stage1 compiler but test --stage library/std
tests the stage1 artifacts.
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'm not sure what you mean... I guess that's the point :)
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.
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 find this table with the arrows is really helpful.
Could you add it to the ### Overview
section?
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.
There were a lot of people in #843 that said it confused more than it helps. I don't have the energy to push this through to an official document, I'm happy to host it on my blog or something.
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.
Or at least, if this is added I would like it to not be in this PR. This PR is mostly uncontroversial changes and gets rid of the wall of text and I don't want to lose those in a debate over what the model of bootstrapping should be.
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.
Oh, I haven't read #843. Nevermind then.
I would preferably like to have this in before the 1.47 release so https://blog.rust-lang.org/inside-rust/2020/08/30/changes-to-x-py-defaults.html can link to something useful instead of the wall of text. @LeSeulArtichaut do you think this is better than what we had before, so I can make any changes in a follow-up? |
It would probably be good to have other opinions from other rustc-dev-guide-WG members |
Sure, cc @rust-lang/wg-rustc-dev-guide |
Personally, I think this is an improvement. Many thanks to @jyn514 for continuing to pursue improvements to the bootstrapping system! |
@mark-i-m can you approve this then so it can be merged? |
🎉 |
This is @RalfJung's view of bootstrapping and so far the most consistent I've seen. Most of this is just an overhaul of the wall of text and doesn't actually materially change the docs, just makes them easier to read.
Obsoletes #843.