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

Building docs for tokio panics #9274

Closed
davidpdrsn opened this issue Mar 16, 2021 · 0 comments · Fixed by #9276
Closed

Building docs for tokio panics #9274

davidpdrsn opened this issue Mar 16, 2021 · 0 comments · Fixed by #9276
Labels
C-bug Category: bug

Comments

@davidpdrsn
Copy link

Problem
Building the docs for tokio in the root of the workspace panics.

❯ RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
thread 'main' panicked at 'no entry found for key', src/tools/cargo/src/cargo/ops/cargo_compile.rs:1638:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It works if run from a subdirectory:

~/dev/tokio
❯ cd tokio

~/dev/tokio/tokio
❯ RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s

Steps

  1. git clone https://github.com/tokio-rs/tokio
  2. cd tokio
  3. RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features

Notes

Output of cargo version:

❯ cargo +nightly version
cargo 1.52.0-nightly (32da9eaa5 2021-03-13)

Tested on macOS 10.15.7.

@davidpdrsn davidpdrsn added the C-bug Category: bug label Mar 16, 2021
@bors bors closed this as completed in 8b08998 Mar 16, 2021
ehuss pushed a commit to ehuss/cargo that referenced this issue Mar 16, 2021
…excrichton

Fix doc duplicate removal of root units.

The doc collision removal code didn't consider the possibility that there was a collision with a root unit.  This caused problems in conjunction with rust-lang#9142 where cargo would panic because a root unit got removed from the graph because of a filename collision. The solution here is to avoid removing root units during the doc collision sweep.

This has a downside that this reintroduces a filename collision.

An alternate solution would be to make the set of root units mutable, and remove from that list, but I figured this is simpler and more conservative.

Fixes rust-lang#9274
hds added a commit to tokio-rs/tokio that referenced this issue Aug 23, 2022
The command to build the documentation locally provided in the
Contribution Guide did not work for all crates in the project workspace.
Specifically, to build the docs for `tokio-stream` the flag `--cfg
docsrs` needs to be in the environment variable `RUSTFLAGS` in addition
to being in `RUSTDOCFLAGS`.

Additionally, there was text describing that the docs cannot be built
from the root of the workspace with a link to rust-lang/cargo#9274. That
issue has since been closed as complete and the listed commands do now
work from the root of the workspace. As such, that text has been
removed.
hds added a commit to tokio-rs/tokio that referenced this issue Aug 24, 2022
The command to build the documentation locally provided in the
Contribution Guide did not work for all crates in the project workspace.
Specifically, to build the docs for `tokio-stream` the flag `--cfg
docsrs` needs to be in the environment variable `RUSTFLAGS` in addition
to being in `RUSTDOCFLAGS`.

Additionally, there was text describing that the docs cannot be built
from the root of the workspace with a link to rust-lang/cargo#9274. That
issue has since been closed as complete and the listed commands do now
work from the root of the workspace. As such, that text has been
removed.
Darksonn pushed a commit to tokio-rs/tokio that referenced this issue Aug 24, 2022
The command to build the documentation locally provided in the
Contribution Guide did not work for all crates in the project workspace.
Specifically, to build the docs for `tokio-stream` the flag `--cfg
docsrs` needs to be in the environment variable `RUSTFLAGS` in addition
to being in `RUSTDOCFLAGS`.

Additionally, there was text describing that the docs cannot be built
from the root of the workspace with a link to rust-lang/cargo#9274. That
issue has since been closed as complete and the listed commands do now
work from the root of the workspace. As such, that text has been
removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant