close
Skip to content

Allow rustdoc JSON rustup component to be installed on stable.#156926

Open
obi1kenobi wants to merge 1 commit into
rust-lang:mainfrom
obi1kenobi:pg/ship-rustdoc-json-with-stable
Open

Allow rustdoc JSON rustup component to be installed on stable.#156926
obi1kenobi wants to merge 1 commit into
rust-lang:mainfrom
obi1kenobi:pg/ship-rustdoc-json-with-stable

Conversation

@obi1kenobi
Copy link
Copy Markdown
Member

@obi1kenobi obi1kenobi commented May 25, 2026

Currently, the rust-docs-json component is only available on nightly Rust.

It would be very useful to cargo-semver-checks to have rustdoc JSON available in stable as well, to allow performing cross-crate linting that involves types from std/core/alloc etc. This will also simplify the process of linting the standard library itself for possible breaking changes, which is something T-libs is interested in as well.

Even though rustdoc JSON is an unstable component, each JSON file carries a version number meaning that the installed files remain parseable and usable with the matching version of rustdoc-types. So even though future stable Rust releases may change the format, it still makes sense to provide this machine-readable artifact that says "this is what the standard lib contained in this stable release."

For avoidance of confusion: different stable releases may ship mutually-incompatible rustdoc format versions in the rust-docs-json component. The component's contents and shape are valid with respect only to the toolchain in which it is found, analogously to how the rustdoc HTML docs component works.

Zulip Discussion

r? @Mark-Simulacrum @GuillaumeGomez

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels May 25, 2026
@obi1kenobi
Copy link
Copy Markdown
Member Author

obi1kenobi commented May 25, 2026

@rustbot label +T-rustdoc +A-rustdoc-json

@rustbot

This comment was marked as resolved.

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels May 25, 2026
@Urgau Urgau added needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. A-rustdoc-json Area: Rustdoc JSON backend T-rustdoc-json-backend Relevant to the rustdoc JSON backend team, which will review and decide on the PR/issue. and removed A-rustdoc-json Area: Rustdoc JSON backend labels May 25, 2026
@obi1kenobi
Copy link
Copy Markdown
Member Author

@rustbot label -T-rustdoc

thanks Urgau! I misspelled the rustdoc JSON team label 🙈

@rustbot rustbot removed the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label May 25, 2026
@GuillaumeGomez
Copy link
Copy Markdown
Member

Just to confirm the rustdoc JSON team is onboard:

@rfcbot fcp merge T-rustdoc-json-backend

@rust-rfcbot
Copy link
Copy Markdown
Collaborator

rust-rfcbot commented May 25, 2026

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

Concerns:

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 Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels May 25, 2026
@Urgau
Copy link
Copy Markdown
Member

Urgau commented May 29, 2026

I'm not sure about doing this, exposing artifacts of an unstable (nightly-only) feature doesn't seems very useful, but I can concede that it might be useful in some circumstances.

(I do think we should try to stabilize the output soon-ish)


I do have a of concern I would like to get resolve before we expose it on stable.

We currently don't have any kind of warning in the json about the unstable-ness of the format, which is fine for a nightly-only but I think the distributed JSON (and all json produced for that matter) should include (at the top) a disclaimer.

Something like this (following .cargo-checksum.json):

{
   "$comment": "The format of this file is unstable and subject to change without notice, please always follow `format_version`.",
   // ...
}

@rfcbot concern no-disclaimer-in-json

@Urgau Urgau added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 29, 2026
@obi1kenobi
Copy link
Copy Markdown
Member Author

obi1kenobi commented May 30, 2026

I'm having a bit of trouble properly interpreting the "not that useful" comment, so just making sure I understand — is your suggestion @Urgau to add a disclaimer to the JSON and then allow the prebuilt std/core/alloc rustdoc JSON component to be installable on stable?

Or is the suggestion to first add a disclaimer, then stabilize the format itself, and then make the prebuilt stdlib rustdoc JSON component installable on stable?

If it's the former, I'm happy to open a PR to do that right away. If it's the latter, I have strong reservations.

@Urgau
Copy link
Copy Markdown
Member

Urgau commented May 31, 2026

Ideally we would stabilize --output-format json first (not the format, it would remain unstable), but I guess we add the disclaimer it's fine to distribute the JSON on stable.

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

Labels

A-rustdoc-json Area: Rustdoc JSON backend disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. needs-fcp This change is insta-stable, or significant enough to need a team FCP to proceed. proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-rustdoc-json-backend Relevant to the rustdoc JSON backend team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants