rust-lang / rust-lang/cargo

`cargo clean -p` does not clean documentation

Open
#8,790 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug Command-clean S-needs-mentor
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Problem

cargo clean -p package should remove target/doc/package, but does not.

Steps

$ cargo new test-doc
     Created binary (application) `test-doc` package
$ cd test-doc
Cargo.toml  src
$ cargo doc
 Documenting test-doc v0.1.0 (/home/joshua/src/rust/test-doc)
    Finished dev [unoptimized + debuginfo] target(s) in 0.70s
$ ls target/doc
ayu.css                main.js                      source-files.js
brush.svg              normalize.css                source-script.js
COPYRIGHT.txt          noscript.css                 SourceSerifPro-Bold.ttf.woff
dark.css               rustdoc.css                  SourceSerifPro-It.ttf.woff
down-arrow.svg         rust-logo.png                SourceSerifPro-LICENSE.md
favicon.ico            search-index.js              SourceSerifPro-Regular.ttf.woff
FiraSans-LICENSE.txt   settings.css                 src
FiraSans-Medium.woff   settings.html                storage.js
FiraSans-Regular.woff  settings.js                  test_doc
LICENSE-APACHE.txt     SourceCodePro-LICENSE.txt    theme.js
LICENSE-MIT.txt        SourceCodePro-Regular.woff   wheel.svg
light.css              SourceCodePro-Semibold.woff
$ cargo clean -p test-doc
$ ls target/doc
ayu.css                main.js                      source-files.js
brush.svg              normalize.css                source-script.js
COPYRIGHT.txt          noscript.css                 SourceSerifPro-Bold.ttf.woff
dark.css               rustdoc.css                  SourceSerifPro-It.ttf.woff
down-arrow.svg         rust-logo.png                SourceSerifPro-LICENSE.md
favicon.ico            search-index.js              SourceSerifPro-Regular.ttf.woff
FiraSans-LICENSE.txt   settings.css                 src
FiraSans-Medium.woff   settings.html                storage.js
FiraSans-Regular.woff  settings.js                  test_doc
LICENSE-APACHE.txt     SourceCodePro-LICENSE.txt    theme.js
LICENSE-MIT.txt        SourceCodePro-Regular.woff   wheel.svg
light.css              SourceCodePro-Semibold.woff
$ cargo clean
$ ls target/doc
ls: cannot access 'target/doc': No such file or directory

Possible Solution(s)

Notes

Output of cargo version:

cargo 1.47.0 (f3c7e066a 2020-08-28), but the bug is also present in cargo 1.48.0-nightly (9d1a4863a 2020-10-05).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no source file or regression test. Start by reproducing the documented sequence with cargo doc followed by cargo clean -p test-doc; done means the package documentation directory is removed while the shared documentation assets remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.