Regression: `RUSTDOCFLAGS=--show-coverage cargo doc` deletes any existing docs
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- rust
- Domain
- build-system, cli
Research direction
Start with the reproduction in the issue: run cargo doc, then RUSTDOCFLAGS=--show-coverage cargo doc, and check target/doc/crate_name. The bisected regression points to rustc commit 27bd3f51a90733aabee45a9019a3aa785eccfd05 and recent rustdoc changes; docs should remain after the second command, including for the docs.rs workflow.
Written by the indexing model from the issue text.
Description
Problem
I tried this code: cargo doc && RUSTDOCFLAGS='-Z unstable-options '--show-coverage cargo doc
I expected to see this happen: There is documentation in target/doc/crate_name
Instead, this happened: The docs get deleted.
searched nightlies: from nightly-2021-04-28 to nightly-2021-04-29
regressed nightly: nightly-2021-04-29
searched commits: from https://github.com/rust-lang/rust/commit/727d101561f9b1e81c6282943292d990288ca479 to https://github.com/rust-lang/rust/commit/ca075d268d2ce315964e1dd195cfe837b8a53f4d
regressed commit: https://github.com/rust-lang/rust/commit/27bd3f51a90733aabee45a9019a3aa785eccfd05
bisected with cargo-bisect-rustc v0.6.0
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
cargo bisect-rustc --script ./docs-exist.sh --preserve --start 2021-04-28 --end 2021-04-29
Looks like this is related to the recent rustdoc changes (rust-lang/cargo#9419 or rust-lang/cargo#9404).
Steps
cargo docRUSTDOCFLAGS=--show-coverage cargo doc[ -e ${CARGO_TARGET_DIR:-target}/doc/crate_name ]
Possible Solution(s)
Only delete the docs folder if the sources or toolchain changes, not the invocation.
Notes
For context, this causes problems for docs.rs because we always run coverage after the docs are generated. We can work around it for now by running coverage before instead, but it would be nice to fix this. In the meantime I've pinned docs.rs to an older toolchain.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/cargo
-
C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
A-completions C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Command-fix
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
cargo remove prints "Removing X" for dependencies that never get removed when the command fails OpenC-bug Command-remove S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100