-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Conversation
…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.
This comment has been minimized.
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.
fbd09b2
to
02f2e7c
Compare
☔ The latest upstream changes (presumably #84471) made this pull request unmergeable. Please resolve the merge conflicts. |
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? |
triage: merge conflict |
Ping from triage: |
I won't have time to work on this in the near future. |
(also, it seems like this is the wrong approach) |
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:
builder.sysroot()
returnsstage0-sysroot
, butbuilder.rustc_libdir()
returnsstage0/lib
.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