Skip to content

bootstrap: improve 'build --help' by explaining what exactly the last example does #42491

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
Jun 9, 2017

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Jun 6, 2017

I recently found myself confused about what exactly gets built how often when I run which command; I think this would have helped me.

One thing I did not touch, but I feel could also be improved, is the wording just above: "For a quick build with a usable compile, you can pass". I am not a native speaker, but this sounds odd to me. Do you mean "For a quick build of a usable compiler" (but then it should say where the usable compiler is produced)? Or do you mean "For a quick build testing if the compiler is usable"? I can reword this, but I'd like to make sure I understand the intent of the message.

What about

    For a quick build of a usable compiler, you can pass:

        ./x.py build --stage 1 src/libtest

    This will first build everything once (like --stage 0 without further
    arguments would), and then use the compiler built in stage 0 to build
    src/libtest and its dependencies.
    Once this is done, build/$ARCH/stage1 contains a usable compiler.

However, I am not sure this is actually true. In particular, why even bother building the libstd in stage 1? AFAIK that ends up in build/*/stage1-std, not in build/*/stage1 (which is filled from build/*/stage0-*).

@rust-highfive
Copy link
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@aidanhs
Copy link
Member

aidanhs commented Jun 8, 2017

r? @alexcrichton

"For a quick build with a usable compile, you can pass".

I looked at your diff before reading your comment, and this confused me independently. Pretty sure it should be 'compiler'.

However, I am not sure this is actually true. In particular, why even bother building the libstd in stage 1?

The compiler built during stage0 (stage0-out) cannot necessarily compile with the snapshot libstd used to build stage0 (stage0-in) because metadata may differ. To ensure libstd is compatible, it needs to be built with the same compiler it gets used with.

Targeting stage 1 libtest is an indirect way of saying "I need both a stage 1 compiler and a libstd compatible with it present in the sysroot".

@aidanhs aidanhs assigned alexcrichton and unassigned brson Jun 8, 2017
@aidanhs aidanhs added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 8, 2017
@alexcrichton
Copy link
Member

Looks good to me! The wording in the PR description also looks great to me, want to insert that as well?

@RalfJung
Copy link
Member Author

RalfJung commented Jun 8, 2017

Targeting stage 1 libtest is an indirect way of saying "I need both a stage 1 compiler and a libstd compatible with it present in the sysroot".

I guess my question is, where is that sysroot? Nothing seems to actually assemble that compiler and its compatible libstd in a single folder hierarchy when I just say --stage 1 src/libtest, does it?

@alexcrichton will do.

@RalfJung
Copy link
Member Author

RalfJung commented Jun 8, 2017

I inserted the wording from the PR description, and confirmed that it is actually true -- i.e., that the given folder (starting with a clean checkout) actually contains a usable compiler.

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

I guess my question is, where is that sysroot?

Technically build/$target/stage1 is the "sysroot" (e.g. it's a valid --sysroot argument). This is assembled by rustbuild in the various "Copying ..." messages it emits.

@bors
Copy link
Collaborator

bors commented Jun 8, 2017

📌 Commit 7359c79 has been approved by alexcrichton

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Jun 8, 2017
…hton

bootstrap: improve 'build --help' by explaining what exactly the last example does

I recently found myself confused about what exactly gets built how often when I run which command; I think this would have helped me.

One thing I did not touch, but I feel could also be improved, is the wording just above: "For a quick build with a usable compile, you can pass".  I am not a native speaker, but this sounds odd to me. Do you mean "For a quick build of a usable compiler" (but then it should say where the usable compiler is produced)? Or do you mean "For a quick build testing if the compiler is usable"? I can reword this, but I'd like to make sure I understand the intent of the message.

What about
```
    For a quick build of a usable compiler, you can pass:

        ./x.py build --stage 1 src/libtest

    This will first build everything once (like --stage 0 without further
    arguments would), and then use the compiler built in stage 0 to build
    src/libtest and its dependencies.
    Once this is done, build/$ARCH/stage1 contains a usable compiler.
```
However, I am not sure this is actually true. In particular, why even bother building the libstd in stage 1? AFAIK that ends up in `build/*/stage1-std`, not in `build/*/stage1` (which is filled from `build/*/stage0-*`).
bors added a commit that referenced this pull request Jun 8, 2017
Rollup of 6 pull requests

- Successful merges: #42307, #42385, #42487, #42491, #42521, #42531
- Failed merges:
bors added a commit that referenced this pull request Jun 8, 2017
bootstrap: improve 'build --help' by explaining what exactly the last example does

I recently found myself confused about what exactly gets built how often when I run which command; I think this would have helped me.

One thing I did not touch, but I feel could also be improved, is the wording just above: "For a quick build with a usable compile, you can pass".  I am not a native speaker, but this sounds odd to me. Do you mean "For a quick build of a usable compiler" (but then it should say where the usable compiler is produced)? Or do you mean "For a quick build testing if the compiler is usable"? I can reword this, but I'd like to make sure I understand the intent of the message.

What about
```
    For a quick build of a usable compiler, you can pass:

        ./x.py build --stage 1 src/libtest

    This will first build everything once (like --stage 0 without further
    arguments would), and then use the compiler built in stage 0 to build
    src/libtest and its dependencies.
    Once this is done, build/$ARCH/stage1 contains a usable compiler.
```
However, I am not sure this is actually true. In particular, why even bother building the libstd in stage 1? AFAIK that ends up in `build/*/stage1-std`, not in `build/*/stage1` (which is filled from `build/*/stage0-*`).
@bors
Copy link
Collaborator

bors commented Jun 8, 2017

⌛ Testing commit 7359c79 with merge 9454dd5...

@bors
Copy link
Collaborator

bors commented Jun 9, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 9454dd5 to master...

@bors bors merged commit 7359c79 into rust-lang:master Jun 9, 2017
@RalfJung RalfJung deleted the bootstrap-help branch July 15, 2017 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants