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
Update build instructions for rustdoc #1117
Conversation
Now build ´rustdoc´ from stage 2 and build the documentation of the standard library: | ||
|
||
```bash | ||
x.py doc std --stage 2 --open |
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.
Normally, stage 1
is supposed to be working. Maybe open an issue on the rust repository about it?
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 would rather just recommend --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 did rebuild it with the current master
something fixed the build process there.
Now stage 1
works too, but it is ~38min on an 8 core CPU.
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.
Stage 1 should never be slower than stage 2. I saw below that stage2 took you about 23 minutes - did you maybe have rustdoc already compiled or something?
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 enabled [llvm] download-ci-llvm = true
in /config.toml
so I did not compile LLVM if I understand correctly
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.
Ok, cool. Let's change this to --stage 1 then (or just omit the stage, the default is correct no it's not, I forgot doc
is different).
src/rustdoc.md
Outdated
x.py doc std --stage 2 --open | ||
``` | ||
|
||
**Note:** `--open` fixes build errors with `libtest`. |
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.
Normally no, it's not supposed to be linked in any way. I think it's stage 2
here which fixed it.
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 am rerunning this to verify, my gut feeling agrees with you
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.
What do you mean by build errors? Documenting with stage 1 works fine for me locally.
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 replied in the bottom, sorry for the confusion
src/rustdoc.md
Outdated
# ============================================================================= | ||
# Global Settings | ||
# ============================================================================= | ||
|
||
# Use different pre-set defaults than the global defaults. | ||
# | ||
# See `src/bootstrap/defaults` for more information. | ||
# Note that this has no default value (x.py uses the defaults in `config.toml.example`). | ||
#profile = <none> | ||
# | ||
# make sure that you do not have a profile set | ||
|
||
# ============================================================================= | ||
# Tweaking how LLVM is compiled | ||
# ============================================================================= |
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.
# ============================================================================= | |
# Global Settings | |
# ============================================================================= | |
# Use different pre-set defaults than the global defaults. | |
# | |
# See `src/bootstrap/defaults` for more information. | |
# Note that this has no default value (x.py uses the defaults in `config.toml.example`). | |
#profile = <none> | |
# | |
# make sure that you do not have a profile set | |
# ============================================================================= | |
# Tweaking how LLVM is compiled | |
# ============================================================================= |
The comment here doesn't seem to be related to the topic, let's shrink it.
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 reduced the amount of text, but would leave some comments
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
|
||
Preconfigure your `/config.toml`: | ||
|
||
```toml |
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.
This is all way overkill. I would suggest x.py setup tools
and nothing else.
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 had "libraries" configured before and the setup would not touch the file anymore, so I decided to do it by hand. Is this intended behaviour?
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.
Ok, then I would recommend profile = "tools"
instead - that applies the latest changes automatically and also means you don't need to copy/paste 20 lines of config.
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.
Are the implications for the "tools" profile documented somewhere? I would like to link to it
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.
All the profiles are documented in bootstrap itself, or otherwise it would get out of date: https://github.com/rust-lang/rust/blob/master/src/bootstrap/defaults/config.tools.toml
Now build ´rustdoc´ from stage 2 and build the documentation of the standard library: | ||
|
||
```bash | ||
x.py doc std --stage 2 --open |
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 would rather just recommend --stage 1.
src/rustdoc.md
Outdated
x.py doc std --stage 2 --open | ||
``` | ||
|
||
**Note:** `--open` fixes build errors with `libtest`. |
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.
What do you mean by build errors? Documenting with stage 1 works fine for me locally.
@jyn514 In his case, it's triggering errors about "libtest not found". Which is why I recommended him to try with |
@GuillaumeGomez that's fine, but we should help @dns2utf8 get --stage 1 working instead of recommending a command that takes twice as long. |
In my opinion building from |
The build error I was getting:
I fixed this by building the docs with the master branch at 855c2d130fb70da1643cf8f696c7aad7537aef34 and then switching to my branch that has mostly JavaScript/CSS differences |
It should be less than ~3 minutes if you set download-rustc = true. profile = tools does that by default. |
Hi @dns2utf8, are you planning to work on this? |
Triage: I'm going to close this as inactive, but feel free to open another PR if anyone is still interested in this change (I think https://github.com/rust-lang/rustc-dev-guide/pull/1389/files#diff-d9ae61aa6e37d7cc365c1ae1c66c801e2741026fbc752d4628dc34f3c5ce9290 updated some instructions but the "Fast builds (for tier 1 targets)" section might be still useful). Thanks for contributing! |
Hi all
I updated the build instructions with all the things I learned while building the docs.
Thank you @GuillaumeGomez for helping me!
Cheers,
Stefan