Repository navigation
Labels
B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
This is a tracking issue for the RFC "Mergeable rustdoc cross-crate info" (rust-lang/rfcs#3662).
Note
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports.
Instead, open a dedicated issue for the specific matter or post in the #t-rustdoc Zulip channel.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- Implement the RFC (rustdoc rfc#3662 changes under unstable flags #129337)
- Add documentation (to Rustdoc Book) -- cc @EtomicBomb
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- Consider removing
--merge=sharedand only allow it by not providing a--mergeflag. This would allow removing the implementation of shared CCI later, once Cargo uses mergeable CCI. Mergeable rustdoc cross-crate info rfcs#3662 (comment)- resolved: We removed
--mergealtogether, and it's inferred from the presence of the flags for which dirs to read/write from.
- resolved: We removed
- What happens if two rustdoc invocations have the same
--write-doc-meta-dirdirectory? Fix, simplify, and document doc meta finalize mode #159473 (comment)
Implementation history
Metadata
Metadata
Assignees
Labels
B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.Status: It's hard to tell what's been done and what hasn't! Someone should do some investigation.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Activity
[-]Tracking Issue for mergeable rustdoc cross-crate info[/-][+]rustdoc: Tracking issue for mergeable cross-crate info[/+]rustdoc-search: add an integration test for CCI
Rollup merge of rust-lang#148186 - notriddle:test-cci, r=GuillaumeGom…
Unrolled build for #148186
rustdoc-search: add an integration test for CCI
Rollup merge of #148186 - notriddle:test-cci, r=GuillaumeGomez,jieyouxu
Rollup merge of rust-lang#148234 - notriddle:doc-cci, r=GuillaumeGomez
Rollup merge of rust-lang#148234 - notriddle:doc-cci, r=GuillaumeGomez
Unrolled build for #148234
Rollup merge of #148234 - notriddle:doc-cci, r=GuillaumeGomez
4 remaining items
GuillaumeGomez commentedon Jan 28, 2026
Might be worth speeding things up. Opening a zulip thread.
GuillaumeGomez commentedon Feb 9, 2026
@rust-lang/cargo is the current design good enough for your team as well? Rustdoc is planning to stabilize it so we'd like to confirm with you it's ok before doing so.
epage commentedon Feb 9, 2026
There is some investigation we still need to do around rebuild tracking.
Currently, the build output for our rustdoc step directly outputs to the artifact directory. If there is any change, the whole thing needs to run. Nothing can be cached. Mergeable information is a little different in that we need to track it independent of the artifact directory but it is generated by the same step as the artifact directory. This can lead to bugs with rebuild detection.
In discussing this, it got us thinking about a more ideal setup and wanted to see what people's thoughts were. When we build binaries, each build unit has an independent piece of information that can be tracked and cached on its own. We don't make any global changes until link time. If rustdoc could go a step further than mergeable information and could generate a unit of information at each step and then only generate HTML at the end, this would align a lot better with caching and rebuild tracking. For example one way this could be done is if rustdoc's HTML renderer was built as a facade over the json output. Each package's build step would generate a json dump and then the final rustdoc call would load the specified json and generate the HTML for them.
bjorn3 commentedon Feb 9, 2026
If I understand correctly when using mergeable cross-crate info, cargo can just tell each rustdoc invocation to put the html files in a separate directory with
--out-dirand only at the end in the same step that doesrustdoc --merge=finalizehardlink all those html files together into the doc output directory. Are you asking for rustdoc to ignore--out-direntirely when doing--merge=noneand put the html files in--parts-out-dirinstead and have--merge=finalizecopy all html files into the--out-dir?weihanglo commentedon Feb 10, 2026
Rustdoc output are generally opaque to Cargo, as it has its own merge rules. The above approach sounds doable, but want to confirm with t-rustdoc if there is any caveat or limitations.
weihanglo commentedon Feb 10, 2026
@GuillaumeGomez this is my little wish, not a blocker
--emit=toolchain-shared-resources#83784 (comment)GuillaumeGomez commentedon Feb 20, 2026
I opened #152902 to stabilize the options.
weihanglo commentedon Mar 20, 2026
The performance of my naive hardlink implementation (weihanglo/cargo#87) doesn't seem good enough to cross the line. The hardlink part on M1 macbook (APFS) took 1minute for hardlinking 305 crate docs with 75k files. It was a similar benchmark like the one in rust-lang/cargo#16309. The other issue of Cargo doing hardlinks is that
rustdocknows how to maintain the out-dir while Cargo doesn't. For example, in this test rustdoc would clean up pre-existing doc for crate with duplicate names. Cargo also doesn't know under out-dir, what are insidesrc/or other directories.camelid commentedon Aug 7, 2026
We should see if there is some way to automatically run our rustdoc-html testsuite on both legacy-shared CCI and mergeable CCI.
tools: document arch/chips crates against their real targets, merge i…
tools: document arch/chips crates against their real targets, merge i…
tools: document arch/chips crates against their real targets, merge i…
tools: document arch/chips crates against their real targets, merge i…
tools: document arch/chips crates against their real targets, merge i…
notriddle commentedon Oct 3, 2026
Dogfood: #163582
Searching for ast::Attribute in rustc: https://doc.rust-lang.org/nightly/nightly-rustc/?search=ast%3A%3Aattribute