cargo icon indicating copy to clipboard operation
cargo copied to clipboard

fix(fingerprint): clean doc dirs for only requested targets

Open weihanglo opened this issue 1 week ago • 1 comments

What does this PR try to resolve?

Previously if rustc version mismatches, Cargo removes all doc directories including target platforms that are not part of the build.

This PR makes it --target aware and stops excessive cleanup, by putting .rustdoc_fingerprint.json in each target platform directory.

How to test and review this PR?

I'd like to reuse this file to track doc parts directories in https://github.com/rust-lang/cargo/pull/16309, and noticed that this file is for the entire workspace rather than per-target, hich is not compatible with mergeable cross-crate info JSONs.

For concurrent safety, build-dir should be locked already since Cargo locks every intent except check (see https://github.com/rust-lang/cargo/pull/16307). This file is touched only under UserIntent::Doc.

weihanglo avatar Dec 03 '25 00:12 weihanglo

r? @epage

rustbot has assigned @epage. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

rustbot avatar Dec 03 '25 00:12 rustbot