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

RUSTDOCFLAGS=--show-coverage cargo doc deletes any existing docs #84790

Closed
jyn514 opened this issue May 1, 2021 · 4 comments
Closed

RUSTDOCFLAGS=--show-coverage cargo doc deletes any existing docs #84790

jyn514 opened this issue May 1, 2021 · 4 comments
Labels
A-doc-coverage Area: Calculating how much of a crate has documentation C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. requires-nightly This issue requires a nightly compiler in some way. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-docs-rs Relevant to the docs-rs subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jyn514
Copy link
Member

jyn514 commented May 1, 2021

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.

Meta

searched nightlies: from nightly-2021-04-28 to nightly-2021-04-29
regressed nightly: nightly-2021-04-29
searched commits: from 727d101 to ca075d2
regressed commit: 27bd3f5

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 
@jyn514 jyn514 added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. C-bug Category: This is a bug. requires-nightly This issue requires a nightly compiler in some way. A-doc-coverage Area: Calculating how much of a crate has documentation T-docs-rs Relevant to the docs-rs subteam, which will review and decide on the PR/issue. labels May 1, 2021
@jyn514
Copy link
Member Author

jyn514 commented May 1, 2021

@ehuss looks like this is related to the recent rustdoc changes (rust-lang/cargo#9419 or rust-lang/cargo#9404).

@jyn514 jyn514 added the T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. label May 1, 2021
@jyn514 jyn514 changed the title rustdoc --show-coverage deletes any existing docs RUSTDOCFLAGS=--show-coverage cargo doc deletes any existing docs May 1, 2021
@jyn514
Copy link
Member Author

jyn514 commented May 1, 2021

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.

@jyn514
Copy link
Member Author

jyn514 commented May 1, 2021

Is there a reason cargo deletes things between each invocation? It should only need to delete things if the toolchain or source files change.

@jyn514
Copy link
Member Author

jyn514 commented May 1, 2021

Closing this in favor of the cargo issue tracker: rust-lang/cargo#9447

@jyn514 jyn514 closed this as completed May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-doc-coverage Area: Calculating how much of a crate has documentation C-bug Category: This is a bug. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. requires-nightly This issue requires a nightly compiler in some way. T-cargo Relevant to the cargo team, which will review and decide on the PR/issue. T-docs-rs Relevant to the docs-rs subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant