Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribute documentation in JSON format via rustup for toolchain components #101383

Closed
LukeMathWalker opened this issue Sep 3, 2022 · 1 comment · Fixed by #101799
Closed
Labels
A-rustdoc-json Area: Rustdoc JSON backend T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@LukeMathWalker
Copy link
Contributor

Problem

It is currently not possible to access the JSON version of the documentation for crates bundled with the toolchain (core, alloc, std, etc.) via the same mechanism used for "normal" crates:

# This does not succeed
cargo +nightly rustdoc -p std --lib -- -Zunstable-options -wjson

This is due to the fact that those crates are pre-compiled.

Proposed solution

rustup already bundles the HTML version of the documentation for those crates.
We can start bundling the JSON version as a separate rustup component, on the nightly toolchain.

Relevant Zulip discussion.

@aDotInTheVoid
Copy link
Member

@rustbot modify labels: +A-rustdoc-json +T-rustdoc +T-infra

@rustbot rustbot added A-rustdoc-json Area: Rustdoc JSON backend T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 3, 2022
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Sep 16, 2022
…, r=jyn514

Distribute json doc

# Overview

We add a new component, `rust-json-docs`, to distribute the JSON version of rustdoc's output for public compiler crates (i.e. `std`, `alloc`, `proc_macro`, `core` and `test`).
As discussed in rust-lang#101383, we do not bundle this up as part of the existing `rust-docs` component since `rustdoc`'s JSON format is still unstable.

# Open questions / Doubts

I tried my best, but I never touched this codebase and I couldn't find much documentation on how `dist` works - I pattern-matched existing code, which might have led to some non-sensical choices in the eyes of people more familiar with the codebase. In particular, I am not sure if my choice of adding a new config flag is appropriate or if the decision to build/not build the JSON docs is more appropriately gated by one of the existing flags.
Any suggestion is more than welcome.

Closes rust-lang#101383
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Sep 17, 2022
…, r=jyn514

Distribute json doc

# Overview

We add a new component, `rust-json-docs`, to distribute the JSON version of rustdoc's output for public compiler crates (i.e. `std`, `alloc`, `proc_macro`, `core` and `test`).
As discussed in rust-lang#101383, we do not bundle this up as part of the existing `rust-docs` component since `rustdoc`'s JSON format is still unstable.

# Open questions / Doubts

I tried my best, but I never touched this codebase and I couldn't find much documentation on how `dist` works - I pattern-matched existing code, which might have led to some non-sensical choices in the eyes of people more familiar with the codebase. In particular, I am not sure if my choice of adding a new config flag is appropriate or if the decision to build/not build the JSON docs is more appropriately gated by one of the existing flags.
Any suggestion is more than welcome.

Closes rust-lang#101383
@bors bors closed this as completed in c8e12cc Sep 19, 2022
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 T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants