Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

dns2utf8
Copy link

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

Now build ´rustdoc´ from stage 2 and build the documentation of the standard library:

```bash
x.py doc std --stage 2 --open
Copy link
Member

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?

Copy link
Member

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.

Copy link
Author

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.

Copy link
Member

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?

Copy link
Author

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

Copy link
Member

@jyn514 jyn514 Apr 29, 2021

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`.
Copy link
Member

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.

Copy link
Author

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

Copy link
Member

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.

Copy link
Author

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 Show resolved Hide resolved
src/rustdoc.md Outdated
Comment on lines 42 to 56
# =============================================================================
# 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
# =============================================================================
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# =============================================================================
# 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.

Copy link
Author

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
Copy link
Member

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.

Copy link
Author

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?

Copy link
Member

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.

Copy link
Author

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

Copy link
Member

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
Copy link
Member

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`.
Copy link
Member

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.

@GuillaumeGomez
Copy link
Member

@jyn514 In his case, it's triggering errors about "libtest not found". Which is why I recommended him to try with --stage 2 and to open an issue.

@jyn514
Copy link
Member

jyn514 commented Apr 28, 2021

@GuillaumeGomez that's fine, but we should help @dns2utf8 get --stage 1 working instead of recommending a command that takes twice as long.

@dns2utf8
Copy link
Author

In my opinion building from stage 2 and the CI artefacts should be possible in ~5min or less, but my current test gave me ~23min. So not that great either

@dns2utf8
Copy link
Author

The build error I was getting:

rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustdoc: error while loading shared libraries: http://libtest-767351f2ae2fb418.so: cannot open shared object file: No such file or directory
error: could not document `core`

image

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

@jyn514 jyn514 changed the title Add faster build tutorial and update cheat sheet Update build instructions for rustdoc Apr 29, 2021
@jyn514 jyn514 added the waiting-on-author This PR is waiting for additional action by the OP label Apr 29, 2021
@jyn514
Copy link
Member

jyn514 commented May 2, 2021

In my opinion building from stage 2 and the CI artefacts should be possible in ~5min or less, but my current test gave me ~23min. So not that great either

It should be less than ~3 minutes if you set download-rustc = true. profile = tools does that by default.

@jyn514
Copy link
Member

jyn514 commented Jul 3, 2021

Hi @dns2utf8, are you planning to work on this?

@JohnTitor
Copy link
Member

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!

@JohnTitor JohnTitor closed this Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-on-author This PR is waiting for additional action by the OP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants