Skip to content

rustdoc: Tracking issue for mergeable cross-crate info #130676

Description

@camelid

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

Unresolved Questions

Implementation history

Activity

  1. added
    B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.
    B-unstableBlocker: Implemented in the nightly compiler and unstable.
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
    on Sep 21, 2024
  2. changed the title [-]Tracking Issue for mergeable rustdoc cross-crate info[/-] [+]rustdoc: Tracking issue for mergeable cross-crate info[/+] on Oct 10, 2025
  3. added
    S-tracking-needs-summaryStatus: It's hard to tell what's been done and what hasn't! Someone should do some investigation.
    on Oct 10, 2025
  4. added a commit that references this issue on Oct 28, 2025
  5. added a commit that references this issue on Oct 28, 2025
  6. added a commit that references this issue on Nov 24, 2025
  7. added a commit that references this issue on Nov 24, 2025
  8. added a commit that references this issue on Nov 24, 2025
  9. 4 remaining items

  10. GuillaumeGomez commented on Jan 28, 2026

    @GuillaumeGomez
    Member

    Might be worth speeding things up. Opening a zulip thread.

  11. GuillaumeGomez commented on Feb 9, 2026

    @GuillaumeGomez
    Member

    @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.

  12. epage commented on Feb 9, 2026

    @epage
    Contributor

    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.

  13. bjorn3 commented on Feb 9, 2026

    @bjorn3
    Member

    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.

    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-dir and only at the end in the same step that does rustdoc --merge=finalize hardlink all those html files together into the doc output directory. Are you asking for rustdoc to ignore --out-dir entirely when doing --merge=none and put the html files in --parts-out-dir instead and have --merge=finalize copy all html files into the --out-dir?

  14. weihanglo commented on Feb 10, 2026

    @weihanglo
    Member

    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-dir and only at the end in the same step that does rustdoc --merge=finalize hardlink all those html files together into the doc output directory. Are you asking for rustdoc to ignore --out-dir entirely when doing --merge=none and put the html files in --parts-out-dir instead and have --merge=finalize copy all html files into the --out-dir?

    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.

  15. weihanglo commented on Feb 10, 2026

    @weihanglo
    Member

    @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.

    @GuillaumeGomez this is my little wish, not a blocker

  16. GuillaumeGomez commented on Feb 20, 2026

    @GuillaumeGomez
    Member

    I opened #152902 to stabilize the options.

  17. weihanglo commented on Mar 20, 2026

    @weihanglo
    Member

    cargo can just tell each rustdoc invocation to put the html files in a separate directory with --out-dir and only at the end in the same step that does rustdoc --merge=finalize hardlink all those html files together into the doc output directory

    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 rustdoc knows 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 inside src/ or other directories.

  18. camelid commented on Aug 7, 2026

    @camelid
    MemberAuthor

    We should see if there is some way to automatically run our rustdoc-html testsuite on both legacy-shared CCI and mergeable CCI.

  19. notriddle commented on Oct 3, 2026

    @notriddle
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: 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.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions