-
Notifications
You must be signed in to change notification settings - Fork 515
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
document keep-stage1 and also try to clarify #191
Conversation
LGTM. Thanks for adding all of this to the guide! 😁🎉 |
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 semi-related question: I've been confused for a long time why some tests have various stage options (like ignore-stage1
). Shouldn't the stage1 compiler be functionally identical to the stage2 compiler?
@ehuss I added a paragraph about that |
Oh, that makes sense. TYVM! |
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.
LGTM :)
Thanks! I was wondering how to use --keep-stage 1 too.
I few minor nits/typos, then r=me
src/how-to-build-and-run.md
Outdated
we can build it again | ||
with stage2 compiler which must be identical to itself, | ||
unless something has broken. | ||
internally. The result is the compiling `rustc` is done in stages: |
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.
s/is the/is that/
src/how-to-build-and-run.md
Outdated
@@ -80,6 +86,8 @@ It is, in particular, very useful when you're doing some kind of | |||
"type-based refactoring", like renaming a method, or changing the | |||
signature of some function. | |||
|
|||
<a name=command> |
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.
Could you please close this tag? Sometimes leaving open tags leads to weird rendering in mdbook.
src/how-to-build-and-run.md
Outdated
build. The **full** rustc build (what you get if you just say `./x.py | ||
build`) has quite a few more steps: | ||
|
||
- Build librustc rustc with the stage1 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.
s/librustc rustc/rustc/ ?
src/how-to-build-and-run.md
Outdated
@@ -140,6 +160,63 @@ release: 1.25.0-dev | |||
LLVM version: 4.0 | |||
``` | |||
|
|||
<a name=workflow> |
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.
same here
src/how-to-build-and-run.md
Outdated
|
||
- Initial test run: `./x.py test -i --stage 1 src/test/ui` | ||
- Subsequent test run: `./x.py test -i --stage 1 src/test/ui --keep-stage 1` | ||
|
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 think it's good to note that the --keep-stage
flag can be passed multiple times.
Furthermore, if you want guaranteed to work and optimal build times when changing just the compiler, the workflow I would suggest is: ./x.py build -i --stage 2 --keep-stage 0
; the --stage 2
is optional. The effect of this command is that when the compiler is changed, we just rebuild it and you have a compiler that is now both fully capable (i.e., proc macros, sysroot fully populated) and you did not need to rebuild std at all. If, however, you wanted to have your changes take effect on the std that compiler uses, then that won't happen with this. But that's relatively rare.
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.
and you did not need to rebuild std at all
I don't think such a compiler can possibly be guaranteed to work. I guess what you mean is "if you want a compiler that avoids the stage1 limitations"?
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 decided not to add this text because I still don't really understand what --keep-stage 0
even means. :) Does it mean that we copy the stdlib from the beta?
I guess in that case maybe we always want to suggest it, unless you are editing the stdlib?
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 pulling out this conversation about
|
I think there's a few workflows to consider: Modifying std, with the intent of trying out some other user-space (i.e., not compiler-space) code. I believe the fastest way to do this today, when iterating, is:
Modifying std, with intent to see results in the compiler. If you don't care about userspace -- which includes tests -- then Modifying the compiler: If you need proc macros, you'll need to invest more time up-front. Use If you don't need proc macros, and aren't changing metadata or other ABI details, you can invest less time up-front. Use In general, any command run with I'm happy to clarify further, not sure if I've properly explained or even explained in the wrong direction -- let me know what would be best. |
80f26c7
to
69cdc0a
Compare
My inclination is to merge this as is and file a follow-up issue with a link to @Mark-Simulacrum's comment. I don't think I have the time to try and write up more detailed notes here (and I also still feel sort of unclear about what anything other than |
Filed #201 |
This documents the
--keep-stage 1
workflow (thanks @Mark-Simulacrum !) and tries to clarify a bit how staging works.cc @sunjay -- the new language is intended to clear up some of the confusion you had around why building
--stage 1 src/libstd
does more than build the standard library. What do you think?