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

x test src/librustdoc with download-rustc enabled builds compiler artifacts and fails with dylib error #91071

Closed
camelid opened this issue Nov 20, 2021 · 3 comments · Fixed by #95369
Labels
A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@camelid
Copy link
Member

camelid commented Nov 20, 2021

It builds compiler artifacts, prints this warning (neither --stage 2 nor --stage 3 fix the issue)

warning: `download-rustc` does nothing when building stage1 tools; consider using `--stage 2` instead

and fails with this dylib error:

   Doc-tests rustdoc
dyld[87760]: Library not loaded: @rpath/libtest-42098205ffd4ab92.dylib
  Referenced from: /Users/noahlev/code/rust/r1/build/aarch64-apple-darwin/stage1/bin/rustdoc
  Reason: tried: '/Users/noahlev/code/rust/r1/build/aarch64-apple-darwin/stage1/lib/libtest-42098205ffd4ab92.dylib' (no such file), '/Users/noahlev/code/rust/r1/build/aarch64-apple-darwin/stage1/lib/rustlib/aarch64-apple-darwin/lib/libtest-42098205ffd4ab92.dylib' (no such file), '/Users/noahlev/code/rust/r1/build/aarch64-apple-darwin/stage1/bin/../lib/libtest-42098205ffd4ab92.dylib' (no such file), '/Users/noahlev/code/rust/r1/build/aarch64-apple-darwin/stage1/bin/../lib/libtest-42098205ffd4ab92.dylib' (no such file), '/Users/noahlev/code/rust/r1/build/aarch64-apple-darwin/stage1-tools/release/deps/libtest-42098205ffd4ab92.dylib' (no such file), '/Users/noahlev/code/rust/r1/build/aarch64-apple-darwin/stage1/lib/libtest-42098205ffd4ab92.dylib' (no such file), '/Users/noahlev/lib/libtest-42098205ffd4ab92.dylib' (no such file), '/usr/local/lib/libtest-42098205ffd4ab92.dylib' (no such file), '/usr/lib/libtest-42098205ffd4ab92.dylib' (no such file)
error: test failed, to rerun pass '--doc'

The tests pass with download-rustc turned off.

cc @jyn514

@camelid camelid added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Nov 20, 2021
@jyn514 jyn514 added the A-contributor-roadblock Area: Makes things more difficult for new or seasoned contributors to Rust label Nov 20, 2021
@jyn514
Copy link
Member

jyn514 commented Nov 20, 2021

Referenced from: /Users/noahlev/code/rust/r1/build/aarch64-apple-darwin/stage1/bin/rustdoc

Hmm, this looks weird, I would expect it to be using stage 2 ...

@jyn514
Copy link
Member

jyn514 commented Mar 27, 2022

Oh, these are unit tests and not UI tests. I don't know the cause of this error but I'm not surprised it's buggy, I've never tried this.

I think it should be possible in theory? Since rustdoc should link to the downloaded rustc_driver and libtest. If I had to guess the bug is that bootstrap is playing games with rustdoc stages again and hard-coding stage 1 for unit tests.

@jyn514
Copy link
Member

jyn514 commented Mar 27, 2022

Oh they're not even unit tests, they're doctests. Yeah that sounds extremely cursed, I would expect it to be a lot of work to fix. That will be in addition to the staging bug though, --no-doc also fails for me.

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 9, 2022
Fix `x test src/librustdoc` with `download-rustc` enabled

The problem was two-fold:
- Bootstrap was hard-coding that unit tests should always run with stage1, not stage2, and
- It hard-coded the sysroot layout in stage1, which puts libLLVM.so in `lib/rustlib/` instead of just `lib/`.

This also takes the liberty of fixing `test src/librustdoc --no-doc`, which has been broken since it was first added. It would be nice at some point to unify this logic with other tests; I opened a Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Inconsistency.20in.20.60x.20test.60

Fixes rust-lang#91071.
@bors bors closed this as completed in 198a154 Apr 9, 2022
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 or seasoned contributors to Rust 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.

2 participants