Skip to content

fix(doc): isolate per-crate rustdoc output with mergeable CCI#86

Closed
weihanglo wants to merge 5 commits intomasterfrom
rustdoc
Closed

fix(doc): isolate per-crate rustdoc output with mergeable CCI#86
weihanglo wants to merge 5 commits intomasterfrom
rustdoc

Conversation

@weihanglo
Copy link
Copy Markdown
Owner

No description provided.

Separate CCI parts JSON files into a dedicated `parts/` subdir.
under the isolated output dir of each doc unit.
The layout looks like:
`<build-dir>/build/<pkg>-<hash>/out/parts/<crate>.json`

This is a preparation of isolating per-crate doc HTML
into a sibling `doc/` subdir.
Prepares for isolating per-crate rustdoc output,
where the artifact doc directory may not yet exist
on the first `cargo doc` invocation.
With `-Zrustdoc-mergeable-info`,
each `rustdoc --merge=none` invocation now writes HTML
to an isolated per-crate build directory
instead of the shared `target/doc/`.

At merge time, Cargo cleans the artifact doc dir,
runs `--merge=finalize` to regenerate shared resources,
then hardlinks per-crate HTML into `target/doc/`.

This eliminates concurrent mutations to the shared artifact dir
during parallel builds and enables future per-crate rebuild tracking.
This documents the current behavior
With `-Zrustdoc-mergeable-info`,
per-crate rustdoc invocations only write to build dir.
The exclusive artifact-dir lock is deferred to `merge_cross_crate_info()`.
This allows concurrent `cargo doc` processes
to run their per-crate rustdoc invocations in parallel
and only serialize at the merge step.
@weihanglo weihanglo closed this Mar 20, 2026
@weihanglo weihanglo deleted the rustdoc branch March 20, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant