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

Can't document compiler crates with --stage 0 #79980

Closed
Nadrieril opened this issue Dec 12, 2020 · 4 comments · Fixed by #95449
Closed

Can't document compiler crates with --stage 0 #79980

Nadrieril opened this issue Dec 12, 2020 · 4 comments · Fixed by #95449
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Nadrieril
Copy link
Member

Nadrieril commented Dec 12, 2020

When I try to run ./x.py doc with compiler-docs = true in config.toml, I get several errors. I started discussing this on Zulip. I am trying this on latest master and a clean build/ directory.

First I got errors related to -Znormalize-docs. #79954 fixed those.
Then I got a 'Unable to resolve external crate proc_macro2' panic. #79984 fixed that.

Finally I got this (even after clearing build/):

error[E0460]: found possibly newer version of crate `std` which `synstructure` depends on
 --> compiler/rustc_macros/src/lib.rs:5:5
  |
5 | use synstructure::decl_derive;
  |     ^^^^^^^^^^^^
  |
  = note: perhaps that crate needs to be recompiled?
  = note: the following crate versions were found:
          crate `std`: /home/nadrieril/wip/forks/rust/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd
-2624c88e637295f4.rlib
          crate `std`: /home/nadrieril/wip/forks/rust/build/x86_64-unknown-linux-gnu/stage0-sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd
-2624c88e637295f4.so
          crate `synstructure`: /home/nadrieril/wip/forks/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps/libsynstructure-3b73f5ee64fee340.rmeta

error: aborting due to previous error

error: could not document `rustc_macros`

And at that point I thought I'd open an issue because I have no idea what's happening.
EDIT: that error is the same as was found in #74976, which seemed to have vanished spontaneously(?).

EDIT: here's my config.toml without the comments:

changelog-seen = 2
[llvm]
download-ci-llvm = true
assertions = true
[build]
compiler-docs = true
[rust]
debug-logging = true
debuginfo-level-rustc = 1
incremental = true
deny-warnings = false

EDIT: tried with incremental = false and got the same error

@Nadrieril Nadrieril added the C-bug Category: This is a bug. label Dec 12, 2020
@jyn514 jyn514 added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Dec 12, 2020
@jyn514
Copy link
Member

jyn514 commented Dec 13, 2020

@Mark-Simulacrum and I think this is the same root cause as #74976 (comment): --target is getting passed to rustdoc but not to rustc, so they use different sysroots. I don't know how to fix this :(

JohnTitor added a commit to JohnTitor/rust that referenced this issue Dec 13, 2020
Remove an unused dependency that made `rustdoc` crash

Whilst struggling with rust-lang#79980 I discovered that this dependency was unused, and that made rustdoc crash. This PR removes it.
@Nadrieril Nadrieril changed the title Can't document compiler crates Can't document compiler crates with --stage 0 Dec 13, 2020
@camelid
Copy link
Member

camelid commented Dec 29, 2020

Noting that it seems #79540 should fix this! See the discussion on Zulip.

@jyn514
Copy link
Member

jyn514 commented Dec 29, 2020

@camelid well, it will still be broken if you don't have download-stage1 turned on. So I think that part might be worth tracking.

@JakobDegen
Copy link
Contributor

Has anything changed since this was last looked at to make this easier to fix? I'm running into this issue

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 5, 2022
Fix `x doc --stage 0 compiler`

Eric figured out the fix to this almost 2 years ago, I just didn't read his comment carefully enough at the timme.
The issue was that fake rustc and fake rustdoc were inconsistent about when they passed `--sysroot` to the real compiler.
Change them to consistently only pass it when `--target` is present.

cc rust-lang#74976 (comment)
Fixes rust-lang#79980

r? `@ehuss`
@bors bors closed this as completed in 73eab35 Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants