Skip to content

fix: stabilize -Zrustdoc-depinfo#17020

Open
weihanglo wants to merge 1 commit into
rust-lang:masterfrom
weihanglo:rustdoc-depinfo
Open

fix: stabilize -Zrustdoc-depinfo#17020
weihanglo wants to merge 1 commit into
rust-lang:masterfrom
weihanglo:rustdoc-depinfo

Conversation

@weihanglo

@weihanglo weihanglo commented May 20, 2026

Copy link
Copy Markdown
Member

---> FCP <---

What does this PR try to resolve?

With this stabilization,
cargo doc unconditionally emits rustdoc depinfo
via rustdoc --emit=dep-info.
Before this, cargo doc used to track file changes via filesystem traversal just like build scripts, and it cannot detect these cases:

  • Cargo target source files are outside the package root, e.g., lib.path = "../lib.rs"
  • Using include_str! to include files outisde pakcage root, e.g., #[doc = include_str!("../outside/pkgroot")]
  • path attribute pointing to outside package root, e.g., #[path = "../outside/pkgroot"]
  • Using env! in doc attribute, e.g., #[doc = env!("…")]

The depinfo files are emitted to Cargo's fingerprint which is a private location so we don't have to commit any stability around it if we want to move it somewhere else in future versions.

Fixes #15370

How to test and review this PR?

While this is a bugfix, I assume we still need an FCP for it.

@weihanglo weihanglo added the T-cargo Team: Cargo label May 20, 2026
@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler A-documenting-cargo-itself Area: Cargo's documentation A-rebuild-detection Area: rebuild detection and fingerprinting A-unstable Area: nightly unstable support S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 20, 2026
@rustbot

rustbot commented May 20, 2026

Copy link
Copy Markdown
Collaborator

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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage

@weihanglo

weihanglo commented May 20, 2026

Copy link
Copy Markdown
Member Author

Oops. This is not going to work without flagging every cargo doc test case nightly-only 🥲

@weihanglo
weihanglo marked this pull request as draft May 20, 2026 21:00
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 20, 2026
@rustbot

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Jun 18, 2026
@weihanglo
weihanglo force-pushed the rustdoc-depinfo branch 2 times, most recently from 1180628 to e143eee Compare July 6, 2026 15:46
@rustbot

This comment has been minimized.

@weihanglo
weihanglo force-pushed the rustdoc-depinfo branch 2 times, most recently from 76c6730 to b76bf7e Compare July 9, 2026 14:47
@weihanglo
weihanglo marked this pull request as ready for review July 9, 2026 15:40
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 9, 2026
@weihanglo

This comment was marked as duplicate.

@weihanglo

Copy link
Copy Markdown
Member Author

@rfcbot fcp merge T-cargo

@rust-rfcbot

rust-rfcbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

@weihanglo has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rust-rfcbot rust-rfcbot added proposed-final-comment-period An FCP proposal has started, but not yet signed off. disposition-merge FCP with intent to merge labels Jul 9, 2026
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@weihanglo weihanglo removed the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label Jul 13, 2026
@ehuss ehuss moved this to FCP merge in Cargo status tracker Jul 14, 2026
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

With this stabilization,
`cargo doc` unconditionally emits rustdoc depinfo
via `rustdoc --emit=dep-info`.
Before this, `cargo doc` used to track file changes
via filesystem traversal.

The depinfo files are emitted to Cargo's fingerprint
which is a private location so we don't have to commit any stability
around it if we want to move it somewhere else in future versions.

Note that `rustdoc --output-format json` still use the old package
fingerprint because `--output-format json` is not yet compatible and
controllable through `--emit`.
@rustbot

rustbot commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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-documenting-cargo-itself Area: Cargo's documentation A-rebuild-detection Area: rebuild detection and fingerprinting A-unstable Area: nightly unstable support disposition-merge FCP with intent to merge proposed-final-comment-period An FCP proposal has started, but not yet signed off. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cargo Team: Cargo

Projects

Status: FCP merge

Development

Successfully merging this pull request may close these issues.

Tracking Issue for -Zrustdoc-depinfo

5 participants