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

Add more about why stage 2 is useful and what constraints bootstrapping has #726

Open
mark-i-m opened this issue May 28, 2020 · 4 comments
Labels
C-enhancement Category: enhancement E-hard Difficulty: might require advanced knowledge E-help-wanted Call for participation: extra help is wanted E-needs-writeup Call for participation: discussion can be written up without much research required T-bootstrap Relevant to bootstrap team T-compiler Relevant to compiler team

Comments

@mark-i-m
Copy link
Member

Some very helpful discussion here: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/why.20stage.202.3F

@mark-i-m mark-i-m added E-help-wanted Call for participation: extra help is wanted E-easy Difficulty: might be a good place for a beginner E-needs-writeup Call for participation: discussion can be written up without much research required labels May 28, 2020
@jyn514
Copy link
Member

jyn514 commented Oct 6, 2020

@mark-i-m do you think this was addressed by #857? Or is there more info that should be added?

@mark-i-m mark-i-m changed the title Add more info about stages Add more about why stage 2 is useful and what constraints bootstrapping has Oct 6, 2020
@mark-i-m
Copy link
Member Author

mark-i-m commented Oct 6, 2020

I changed the title. I think the current docs still don't get me to the point where I fully/intuitively understand the requirements for bootstrapping. For example. I still find it hard to grasp the answers to things like this:

  • Why is stage 2 needed at all? (which Mark answers in that thread)
  • Why can't we make rustc build with beta std or vice versa?
  • Why is cfg(bootsrap) needed?
  • Why not in the compiler?
  • Why build the compiler with beta instead of something else?
  • etc

I believe you have had a deep dive into these sorts of questions recently too.

@jyn514
Copy link
Member

jyn514 commented Oct 6, 2020

Why can't we make rustc build with beta std or vice versa?

This is a policy decision (that I don't agree with, but has merits). See https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Building.20rustc.20with.20beta.20libstd for a very long discussion, I'll try to get around to summarizing it at some point.

Why is cfg(bootsrap) needed?

Does this help? https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#complications-of-bootstrapping

Why not in the compiler?

Does this help? https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html#why-does-only-libstd-use-cfgbootstrap

Why build the compiler with beta instead of something else?

I've been meaning to ask that myself ... I think it's come up on zulip a few times, I need to go back and look.

@Mark-Simulacrum
Copy link
Member

Why build the compiler with beta instead of something else?

I've been meaning to ask that myself ... I think it's come up on zulip a few times, I need to go back and look.

Distributions (at least) want to be able to build the next Rust, say, 1.46.0 with 1.45.0. This means bootstrapping with beta in our CI (which will become bootstrapping with stable on beta branch, bootstrapping with previous stable on stable branch).

We also have the often overlooked, and somewhat softer, requirement that Rust 1.46.0 should be able to build 1.46.0; this is sort of covered by a stage 1/2 build but often runs into trouble with bootstrap tools using unstable features, though we've been gradually moving away from that over time. rustbuild does automatically detect this situation and skips passing --cfg bootstrap when building the compiler & std, though.


Just wanted to note that as always I am happy to chat about these things, let me know.

@jieyouxu jieyouxu added E-hard Difficulty: might require advanced knowledge C-enhancement Category: enhancement T-compiler Relevant to compiler team T-bootstrap Relevant to bootstrap team and removed E-easy Difficulty: might be a good place for a beginner labels Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: enhancement E-hard Difficulty: might require advanced knowledge E-help-wanted Call for participation: extra help is wanted E-needs-writeup Call for participation: discussion can be written up without much research required T-bootstrap Relevant to bootstrap team T-compiler Relevant to compiler team
Projects
None yet
Development

No branches or pull requests

4 participants