-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 json doc #101799
Distribute json doc #101799
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jyn514 (or someone else) soon. Please see the contribution instructions for more information. |
This comment has been minimized.
This comment has been minimized.
@rustbot modify labels: +A-rustdoc-json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks roughly right, but I think we can simplify it quite a bit.
Once you've made the change that builds the JSON docs whenever the normal docs are built, I can run @bors try
to generate the rust-json-docs
component and verify that it has the output you expect. You can also run x dist rust-json-docs
locally and look at the tarball in build/dist
.
@rustbot author |
This comment has been minimized.
This comment has been minimized.
@rustbot label -S-waiting-on-author +S-waiting-on-review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks in a lot better shape, thanks :) just a few small comments.
if requested_crates.iter().any(|p| p == krate) { | ||
// No need to document more of the libraries if we have the one we want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks extremely suspicious, but it was already here before so no need to fix it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this felt broken to me as well - especially considering that we have a vector of request crates but we abort as soon as one of those is built (instead of making sure that all of them are built).
r=me with that last comment addressed and the commits squashed :) thanks for sticking with this! |
37d0444
to
ccd4383
Compare
r? @jyn514 |
Thank you for guiding me through it @jyn514! |
@bors r+ |
I've added a check before attempting the deletion (alternatively I can add |
I noticed that after this change we'll print documenting std twice. Can you fix that while you're at it? |
…ed documentation for std crates in nightly toolchains. We also add a new flag to `x doc`, `--json`, to render the JSON-formatted version alongside the HTML-formatted one.
e244549
to
235dcce
Compare
Fixed it! @jyn514 |
@bors r+ |
⌛ Testing commit 235dcce with merge 8b5ebc275c2ef02347a6a6c1496ea49b411259bd... |
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (c8e12cc): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Footnotes |
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
andtest
).As discussed in #101383, we do not bundle this up as part of the existing
rust-docs
component sincerustdoc
'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 #101383