Skip to content

CONTRIBUTING.md: Use build --stage 1 instead of build --stage 2 #1612

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

Merged
merged 2 commits into from
Nov 7, 2020

Conversation

camelid
Copy link
Member

@camelid camelid commented Oct 30, 2020

It seems to work fine with --stage 1 and it should be faster.

Cc #1610
Cc @jyn514

@camelid camelid changed the title Use build --stage 1 instead of build --stage 2 Use build --stage 1 instead of build --stage 2 in CONTRIBUTING.md Oct 30, 2020
It seems to work fine with `--stage 1` and it should be faster.
@camelid camelid changed the title Use build --stage 1 instead of build --stage 2 in CONTRIBUTING.md CONTRIBUTING.md: Use build --stage 1 instead of build --stage 2 Oct 30, 2020
# This step can take 30 minutes or more.
./x.py build --stage 2 compiler/rustc
./x.py build --stage 1 compiler/rustc
Copy link
Member

Choose a reason for hiding this comment

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

Still not sure why compiler/rustc is necessary, but that's a mystery for another day.

@RalfJung
Copy link
Member

It seems to work fine with --stage 1 and it should be faster.

It should be barely any faster, both build rustc exactly twice... the only extra work that --stage 1 compiler/rustc does is some uplifting I think.

So I doubt this actually makes things much faster.

@RalfJung
Copy link
Member

I tested this, and indeed (to my great surprise) after doing --stage 1 compiler/rustc, using the stage 1 compiler with Miri actually works. Maybe proc-macros are more decoupled from rustc now than they used to be, or maybe I never tested this particular combination of things... not sure.

However, after --stage 1 compiler/rustc is complete, doing --stage 2 compiler/rustc takes <5s. It just copies some things around:

$ nice ./x.py -j4 build --stage 2 compiler/rustc
    Finished dev [unoptimized + debuginfo] target(s) in 0.76s
Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.31s
Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage0 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.68s
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.15s
Copying stage1 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Building stage1 compiler artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
    Finished release [optimized + debuginfo] target(s) in 0.33s
Copying stage1 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage2 compiler (x86_64-unknown-linux-gnu)
Uplifting stage1 std (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage2 std from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
Copying stage2 rustc from stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Build completed successfully in 0:00:04

So this does not actually save any time. But it seems conceptually simpler, so recommending stage 1 still seems like a good idea.

@RalfJung
Copy link
Member

RalfJung commented Nov 7, 2020

@camelid what are your plans for this PR? It is currently also blocking #1615, so it'd be great if you could take care of the remaining concern. :)

@camelid
Copy link
Member Author

camelid commented Nov 7, 2020

@RalfJung I think I must have thought there was something else to do, but it seems not. Ready to be merged!

@RalfJung
Copy link
Member

RalfJung commented Nov 7, 2020

Thanks! @bors r+

@bors
Copy link
Contributor

bors commented Nov 7, 2020

📌 Commit 6a475c3 has been approved by RalfJung

@bors
Copy link
Contributor

bors commented Nov 7, 2020

⌛ Testing commit 6a475c3 with merge 85a9a43...

@bors
Copy link
Contributor

bors commented Nov 7, 2020

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 85a9a43 to master...

@bors bors merged commit 85a9a43 into rust-lang:master Nov 7, 2020
@camelid camelid deleted the patch-1 branch November 7, 2020 20:42
bors added a commit that referenced this pull request Nov 7, 2020
Improve contributing instructions

This builds on the changes from #1612 and should not be merged before.

- Fix incorrect comment
- Recommend `x.py setup` over manually editing config.toml
- Link to rustc-dev-guide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants