Skip to content

Conversation

@weihanglo
Copy link
Member

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 #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 #16307).
This file is touched only under UserIntent::Doc.

@rustbot
Copy link
Collaborator

rustbot commented Dec 3, 2025

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 rustbot added A-build-execution Area: anything dealing with executing the compiler A-cfg-expr Area: Platform cfg expressions A-rebuild-detection Area: rebuild detection and fingerprinting S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 3, 2025
@weihanglo weihanglo force-pushed the rustdoc branch 2 times, most recently from 807aec7 to 33747b0 Compare December 3, 2025 01:05
This is a preparation for per-target check.
Currently it checks only host build-dir for the entire workspace
Previously if rustc version mismatches,
this removes all `doc` directories including target platforms that are
not part of the build.

This makes it `--target` aware and stops excessive cleanup,
by putting `.rustdoc_fingerprint.json` in each target directory.
@epage epage added this pull request to the merge queue Dec 3, 2025
Merged via the queue into rust-lang:master with commit 05e32af Dec 3, 2025
26 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 3, 2025
bors added a commit to rust-lang/rust that referenced this pull request Dec 5, 2025
Update cargo submodule

9 commits in bd979347d814dfe03bba124165dbce9554d0b4d8..2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac
2025-12-02 16:03:50 +0000 to 2025-12-04 16:47:28 +0000
- fix(publish): Move `.crate` out of final artifact location (rust-lang/cargo#15915)
- Remove legacy tmpdir support (rust-lang/cargo#16342)
- Run clippy CI on more targets (rust-lang/cargo#16340)
- feat: support for rustdoc mergeable cross-crate info (rust-lang/cargo#16309)
- fix(timings): unlocked -> unblocked (rust-lang/cargo#16337)
- fix(layout): Put examples in their unit dir in new layout (rust-lang/cargo#16335)
- fix(frontmatter): Restrict code fence length  (rust-lang/cargo#16334)
- Update resolver.md: fix compile errors in pseudocode (rust-lang/cargo#16333)
- fix(fingerprint): clean doc dirs for only requested targets (rust-lang/cargo#16331)

This is best being merged before beta cutoff because rust-lang/cargo#16337 is a nightly regression.
@rustbot rustbot added this to the 1.93.0 milestone Dec 5, 2025
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Dec 5, 2025
Update cargo submodule

9 commits in bd979347d814dfe03bba124165dbce9554d0b4d8..2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac
2025-12-02 16:03:50 +0000 to 2025-12-04 16:47:28 +0000
- fix(publish): Move `.crate` out of final artifact location (rust-lang/cargo#15915)
- Remove legacy tmpdir support (rust-lang/cargo#16342)
- Run clippy CI on more targets (rust-lang/cargo#16340)
- feat: support for rustdoc mergeable cross-crate info (rust-lang/cargo#16309)
- fix(timings): unlocked -> unblocked (rust-lang/cargo#16337)
- fix(layout): Put examples in their unit dir in new layout (rust-lang/cargo#16335)
- fix(frontmatter): Restrict code fence length  (rust-lang/cargo#16334)
- Update resolver.md: fix compile errors in pseudocode (rust-lang/cargo#16333)
- fix(fingerprint): clean doc dirs for only requested targets (rust-lang/cargo#16331)

This is best being merged before beta cutoff because rust-lang/cargo#16337 is a nightly regression.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-build-execution Area: anything dealing with executing the compiler A-cfg-expr Area: Platform cfg expressions A-rebuild-detection Area: rebuild detection and fingerprinting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants