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

Fix x.py doc --stage 1 src/tools/error_index_generator #84776

Closed
wants to merge 2 commits into from

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented May 1, 2021

The error index is a complicated tool (because it depends on rustdoc)
and this fix is only one of many possible approaches.

Here is the sequence of fixes that culminated in this commit:

  1. The error index gives an error that libLLVM-nightly.so isn't found.
  2. libLLVM-nightly.so is present in stage1/lib, but not in stage0/lib.
  3. builder.sysroot() returns stage0-sysroot, but
    builder.rustc_libdir() returns stage0/lib.
  4. Therefore, special case the sysroot to be stage0 for the error index and copy libLLVM-nightly.so into it.

Another, possibly better fix is to stop depending on rustdoc at all, and
call it as a binary or separate out a shared crate. But that's a larger
refactor.

Builds on #84471. This is the same diff as #84471 (comment). Helps with #78778. Fixes #80096.

r? @Mark-Simulacrum

…true`

Previously, the LD_LIBRARY_PATH for the linkchecker looked like
`build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib`, because the linkchecker depends on the master copy of the standard library. This is true, but doesn't include the library path for the compiler libraries:

```
/home/joshua/src/rust/rust/build/x86_64-unknown-linux-gnu/stage1-tools-bin/error_index_generator: error while loading shared libraries: libLLVM-12-rust-1.53.0-nightly.so: cannot open shared object file: No such file or directory
```

That file is in
`build/x86_64-unknown-linux-gnu/stage1/lib/libLLVM-12-rust-1.53.0-nightly.so`,
which wasn't included in the dynamic path. This adds `build/x86_64-unknown-linux-gnu/stage1/lib` to the dynamic path for the linkchecker.
@jyn514 jyn514 added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself labels May 1, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 1, 2021
@rust-log-analyzer

This comment has been minimized.

The error index is a complicated tool (because it depends on rustdoc)
and this fix is only one of many possible approaches.

Here is the sequence of fixes that culminated in this commit:

1. The error index gives an error that libLLVM-nightly.so isn't found.
2. libLLVM-nightly.so is present in stage1/lib, but not in stage0/lib.
3. `builder.sysroot()` returns `stage0-sysroot`, but
   `builder.rustc_libdir()` returns `stage0/lib`.
4. Therefore, special case the sysroot to be `stage0` for the error index.

Another, possibly better fix is to stop depending on rustdoc at all, and
call it as a binary or separate out a shared crate. But that's a larger
refactor.
@bors
Copy link
Contributor

bors commented May 2, 2021

☔ The latest upstream changes (presumably #84471) made this pull request unmergeable. Please resolve the merge conflicts.

@Mark-Simulacrum
Copy link
Member

stage0/lib contains libLLVM-12-rust-1.52.0-beta.so -- if we are running a stage 0 error index, it links against the bootstrap compiler, right? So it should link to that LLVM.

IIRC the stage 0 rustdoc/error-index builds are specifically intended to link to the nightly compiler rather than building a local one to help developers reduce build times if they don't actually need a compiler, but maybe that's not the case anymore?

Regardless, I am a bit worried about modifying and passing in the stage0/lib directory to the search path if the above is not true; it definitely contains "bootstrap" compiler libraries, and I can see us easily running into "compiled with the wrong version" errors with this patch, right?

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 6, 2021
@crlf0710 crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 22, 2021
@crlf0710 crlf0710 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 11, 2021
@JohnCSimon JohnCSimon added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 27, 2021
@JohnCSimon
Copy link
Member

triage: merge conflict

@JohnCSimon
Copy link
Member

Ping from triage:
@jyn514 - can you please resolve this merge conflict so this can move forward?

@jyn514
Copy link
Member Author

jyn514 commented Jul 12, 2021

I won't have time to work on this in the near future.

@jyn514 jyn514 closed this Jul 12, 2021
@jyn514 jyn514 deleted the linkcheck-llvm-stage1 branch July 12, 2021 14:06
@jyn514
Copy link
Member Author

jyn514 commented Jul 12, 2021

(also, it seems like this is the wrong approach)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error_index_generator: error while loading shared libraries: libLLVM-11-rust-1.50.0-nightly.so
7 participants