Skip to content
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

Merged
merged 5 commits into from
Oct 4, 2020

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Sep 8, 2020

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.

Copy link
Member

@camelid camelid left a 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 :)

src/building/bootstrapping.md Outdated Show resolved Hide resolved
src/building/bootstrapping.md Outdated Show resolved Hide resolved
@camelid

This comment has been minimized.

@jyn514 jyn514 added E-hard Difficulty: might require advanced knowledge S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content E-help-wanted Call for participation: extra help is wanted labels Sep 8, 2020
@RalfJung
Copy link
Member

RalfJung commented Sep 8, 2020

@RalfJung's view of bootstrapping

FWIW I know this as the @eddyb view of bootstrapping, which they explained https://github.com/rust-lang/rust/issues/59864.^^

@RalfJung
Copy link
Member

RalfJung commented Sep 8, 2020

Also should this be marked as closing rust-lang/rust#57963 ?

@jyn514
Copy link
Member Author

jyn514 commented Sep 8, 2020

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.

@jyn514
Copy link
Member Author

jyn514 commented Sep 15, 2020

Pinging a random person who's involved with bootstrapping:

r? @ehuss

@jyn514
Copy link
Member Author

jyn514 commented Sep 22, 2020

ping @Mark-Simulacrum - I know you have trouble explaining staging, but could you double check the information is accurate?

@jyn514
Copy link
Member Author

jyn514 commented Oct 1, 2020

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 :)

Copy link
Contributor

@LeSeulArtichaut LeSeulArtichaut left a 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

src/building/bootstrapping.md Show resolved Hide resolved
src/building/bootstrapping.md Outdated Show resolved Hide resolved
src/building/bootstrapping.md Outdated Show resolved Hide resolved
src/building/bootstrapping.md Outdated Show resolved Hide resolved
src/building/bootstrapping.md Outdated Show resolved Hide resolved
src/building/bootstrapping.md Show resolved Hide resolved
src/building/bootstrapping.md Outdated Show resolved Hide resolved
@camelid
Copy link
Member

camelid commented Oct 1, 2020

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.

- 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.
src/building/bootstrapping.md Outdated Show resolved Hide resolved
Comment on lines +134 to +135
- The "stage (N+1) compiler" is assembled from "stage N artifacts". This
process is called _uplifting_.
Copy link
Member

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"?

Copy link
Member Author

@jyn514 jyn514 Oct 1, 2020

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

Copy link
Member

@camelid camelid left a 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!

src/building/bootstrapping.md Outdated Show resolved Hide resolved
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

Copy link
Member

@camelid camelid Oct 1, 2020

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
Suggested change
### 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 |

Copy link
Member Author

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.

Copy link
Member

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 :)

Copy link
Member Author

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.

Copy link
Member

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 :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can add a link to
image
but you said yourself it confused you more than it helps. I don't know any better way to say it; any view that doesn't have different sections for the compiler and standard library is going to be incomplete and misleading.

Copy link
Contributor

@Julian-Wollersberger Julian-Wollersberger Oct 2, 2020

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

@jyn514
Copy link
Member Author

jyn514 commented Oct 2, 2020

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?

@LeSeulArtichaut
Copy link
Contributor

It would probably be good to have other opinions from other rustc-dev-guide-WG members

@jyn514
Copy link
Member Author

jyn514 commented Oct 2, 2020

Sure, cc @rust-lang/wg-rustc-dev-guide

@mark-i-m
Copy link
Member

mark-i-m commented Oct 4, 2020

Personally, I think this is an improvement. Many thanks to @jyn514 for continuing to pursue improvements to the bootstrapping system!

@jyn514
Copy link
Member Author

jyn514 commented Oct 4, 2020

@mark-i-m can you approve this then so it can be merged?

@LeSeulArtichaut LeSeulArtichaut merged commit 1087878 into rust-lang:master Oct 4, 2020
@jyn514 jyn514 deleted the stages-take-N+1 branch October 4, 2020 14:25
@jyn514
Copy link
Member Author

jyn514 commented Oct 4, 2020

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-hard Difficulty: might require advanced knowledge E-help-wanted Call for participation: extra help is wanted S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants