Stream: t-compiler

Topic: when to rebuild


nikomatsakis (Sep 27 2018 at 14:02, on Zulip):

@blitzerr

regarding your questions:

Are you asking if — after fetching from upstream — --keep-stage 1 will "still work"? The answer is unknowable; put another way, --keep-stage 1 is never guaranteed to work. But it's far less likely when pulling from upstream, which has an unknown set of changes. I think that after rebasing I would recommend not using it.

Or you can wait and see if you get strange ICEs and errors. :P

blitzerr (Sep 27 2018 at 14:51, on Zulip):

Yup, got a compiler panic :slight_smile: what does ICE stand for ?

nikomatsakis (Sep 27 2018 at 14:51, on Zulip):

"internal compiler error"

blitzerr (Sep 27 2018 at 14:52, on Zulip):

Cool

blitzerr (Sep 27 2018 at 14:54, on Zulip):

So, say I pulled from up stream, I did complete build.
Then I made some changes on top. Now I can use keep stage 1 right?

blitzerr (Sep 27 2018 at 14:56, on Zulip):

Also now when I want to compile a test file to see the effects of my latest changes, should I use

Rustc +stage2 <file to compile>?
Or
Rust +stage1 <file>

nikomatsakis (Sep 27 2018 at 14:57, on Zulip):

@blitzerr that depends on what command you gave to x.py...

nikomatsakis (Sep 27 2018 at 14:57, on Zulip):

I usually do ./x.py build --stage 1 -i src/libstd, in which case you would run with +stage1

blitzerr (Sep 27 2018 at 14:57, on Zulip):

So the question is the stage 2 is the compiler with the latest changes, right ?

So we do rust-build with keep stage1 and then use +stage2 to see the affects of the latest changes ?

nikomatsakis (Sep 27 2018 at 14:58, on Zulip):

the..huh?

nikomatsakis (Sep 27 2018 at 14:58, on Zulip):

so

nikomatsakis (Sep 27 2018 at 14:58, on Zulip):

first off, ignore --keep-stage 1 entirely, it's not relevant :)

blitzerr (Sep 27 2018 at 14:58, on Zulip):

So you only want to build libstd ?

nikomatsakis (Sep 27 2018 at 14:58, on Zulip):

let's just assume you never use it

nikomatsakis (Sep 27 2018 at 14:58, on Zulip):

did you read the explanation page about this?

nikomatsakis (Sep 27 2018 at 14:59, on Zulip):

https://rust-lang-nursery.github.io/rustc-guide/how-to-build-and-run.html

nikomatsakis (Sep 27 2018 at 14:59, on Zulip):

in particular, this section, which explains that specific command :)

nikomatsakis (Sep 27 2018 at 14:59, on Zulip):

it doesn't just build libstd.. it builds up to libstd in stage1

nikomatsakis (Sep 27 2018 at 14:59, on Zulip):

which includes building the stage1 rustc

nikomatsakis (Sep 27 2018 at 15:00, on Zulip):

if you want to run the stage2 compiler, you have to build up to stage 2

nikomatsakis (Sep 27 2018 at 15:00, on Zulip):

e.g., ./x.py build --stage 2 src/libstd

nikomatsakis (Sep 27 2018 at 15:00, on Zulip):

but normally that doesn't gain you much and just takes more time

blitzerr (Sep 27 2018 at 15:04, on Zulip):

Okay, I see. We never need to build the stage2.

blitzerr (Sep 27 2018 at 15:07, on Zulip):

Is this doc recently updated ? It's very clear now.

nikomatsakis (Sep 27 2018 at 15:08, on Zulip):

I did revise recently, not sure just when

blitzerr (Sep 27 2018 at 15:21, on Zulip):

rustup toolchain link stage1 build/<host-triple>/stage1

blitzerr (Sep 27 2018 at 15:21, on Zulip):

That's need to be done just once, or after every build ?

varkor (Sep 27 2018 at 15:25, on Zulip):

just once

blitzerr (Sep 27 2018 at 15:31, on Zulip):

thanks @varkor

Last update: Nov 22 2019 at 04:30UTC