mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

[email protected] ignores rust-toolchain when running rustdoc

Open ma2bd opened this issue 1 year ago • 2 comments

Problem

[email protected] ignores rust-toolchain when running rustdoc.

This is problematic when running mdbook test -L PATH where PATH contains compiled crates -- likely compiled in a way that doesn't ignore rust-toolchain.

[email protected] is still fine.

Steps

Let me know if you need actual repro steps. I used our own repository. See the CI runs on the commits of https://github.com/linera-io/linera-documentation/pull/171

Possible Solution(s)

No response

Notes

No response

Version


ma2bd avatar Dec 08 '24 15:12 ma2bd

Hm, yea, it looks like this changed as a result of #2259 which changed it so that rustdoc's current directory is inside the temp folder in order to generate better path displays. I'm not entirely sure how to fix that. Unfortunately it doesn't look like rustup provides a rustup run that will use the current directory's override.

One option might be some kind of path remapping, which I'm uncertain if that is implemented yet (https://github.com/rust-lang/cargo/issues/9887).

ehuss avatar Dec 08 '24 15:12 ehuss

One easy way to get bitten by this is to have rust toolchain installed in github actions using actions-rust-lang/setup-rust-toolchain. It uses rustup to install the toolchain, and rustup override to make it the default in repo directory. If you then use mdbook test, then it will use different rustdoc than the one installed by rustup, and fail. Our CI that started failing when rust version preinstalled on runners is different than latest stable: https://github.com/scylladb/scylla-rust-driver/blob/main/.github/workflows/book.yml

Lorak-mmk avatar Oct 03 '25 12:10 Lorak-mmk