rust
rust copied to clipboard
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 #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 #101383
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.
The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
cc @Mark-Simulacrum
@rustbot modify labels: +A-rustdoc-json
@rustbot author
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
Compiling toml v0.5.9
error[E0382]: borrow of moved value: `run`
--> dist.rs:100:55
|
99 | fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
| --- move occurs because `run` has type `ShouldRun<'_>`, which does not implement the `Copy` trait
100 | run.alias("rust-json-docs").default_condition(run.builder.config.docs)
| |
| |
| `run` moved due to this method call
|
note: this function takes ownership of the receiver `self`, which moves `run`
|
|
438 | pub fn alias(mut self, alias: &str) -> Self {
| ^^^^
= note: borrow occurs due to deref coercion to `Build`
note: deref defined here
|
47 | type Target = Build;
| ^^^^^^^^^^^
@rustbot label -S-waiting-on-author +S-waiting-on-review
The job mingw-check failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions := True
configure: dist.missing-tools := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure:
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
Build completed successfully in 0:03:30
+ RUSTDOCFLAGS=--document-private-items python3 ../x.py doc --stage 0 library/test
Building rustbuild
Finished dev [unoptimized] target(s) in 0.05s
thread 'main' panicked at 'fs::copy(builder.src.join("src/doc/rust.css"), out.join("rust.css")) failed with No such file or directory (os error 2)', doc.rs:437:9
Build completed unsuccessfully in 0:00:00
r=me with that last comment addressed and the commits squashed :) thanks for sticking with this!
r? @jyn514
Thank you for guiding me through it @jyn514!
@bors r+
:pushpin: Commit ccd4383ad79f2306ba74b921d1222e689c27475c has been approved by jyn514
It is now in the queue for this repository.
@bors r- probably failed in a rollup: https://github.com/rust-lang/rust/pull/101941#issuecomment-1250101138
I've added a check before attempting the deletion (alternatively I can add try_remove_dir method and handle the error that is returned).
@rustbot label -S-waiting-on-author +S-waiting-on-review
I noticed that after this change we'll print documenting std twice. Can you fix that while you're at it?
Fixed it! @jyn514
@bors r+
:pushpin: Commit 235dccef2b8012e7d9da87f4b6091912d802cff2 has been approved by jyn514
It is now in the queue for this repository.
:hourglass: Testing commit 235dccef2b8012e7d9da87f4b6091912d802cff2 with merge 8b5ebc275c2ef02347a6a6c1496ea49b411259bd...
:broken_heart: Test failed - checks-actions
A job failed! Check out the build log: (web) (plain)
Click to see the possible cause of the failure (guessed by this bot)
curl: (56) OpenSSL SSL_read: Connection reset by peer, errno 54
@bors retry
:hourglass: Testing commit 235dccef2b8012e7d9da87f4b6091912d802cff2 with merge c8e12cc8bf0de646234524924f39c85d9f3c7c37...
:sunny: Test successful - checks-actions Approved by: jyn514 Pushing c8e12cc8bf0de646234524924f39c85d9f3c7c37 to master...
Finished benchmarking commit (c8e12cc8bf0de646234524924f39c85d9f3c7c37): comparison URL.
Overall result: no relevant changes - no action needed
@rustbot label: -perf-regression
Instruction count
This benchmark run did not return any relevant results for this metric.
Max RSS (memory usage)
Results
This 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.
| mean[^1] | range | count[^2] | |
|---|---|---|---|
| Regressions ❌ (primary) |
- | - | 0 |
| Regressions ❌ (secondary) |
2.6% | [1.9%, 3.4%] | 2 |
| Improvements ✅ (primary) |
- | - | 0 |
| Improvements ✅ (secondary) |
-2.7% | [-2.8%, -2.5%] | 2 |
| All ❌✅ (primary) | - | - | 0 |
Cycles
This benchmark run did not return any relevant results for this metric.
[^1]: the arithmetic mean of the percent change [^2]: number of relevant changes