Uh oh!
There was an error while loading. Please reload this page.
Set --cfg bootstrap for stage0 rustdoc - #71458
Conversation
Mark-Simulacrum
commented
Apr 23, 2020
I think we should actually fix this in src/bootstrap/builder.rs. We currently configure RUSTFLAGS_BOOTSTRAP and such, but we (I guess) should also set RUSTDOCFLAGS or so. Please make sure that happens both in the explicit places and in the Cargo structs handling of such. I don't think we actually need the split for any of the flags we pass (i.e. we can always pass both identically); if not we'll want to explicitly set the stage via RUSTDOCFLAGS in builder.rs like we do with RUSTFLAGS_BOOTSTRAP. |
ecstatic-morse
commented
Apr 23, 2020
@Mark-Simulacrum can you be more specific about what you want? The only reference to |
431602b to
7a20bc6Compareecstatic-morse
commented
Apr 23, 2020
I'm gonna assume you want something like 7a20bc6. |
Mark-Simulacrum
commented
Apr 23, 2020
Sorry, no, I meant that this block here: https://github.com/rust-lang/rust/blob/master/src/bootstrap/builder.rs#L780-L792 should already be setting up the stage cfg correctly, but that's used by the cargo struct later only to set RUSTFLAGS here: https://github.com/rust-lang/rust/blob/master/src/bootstrap/builder.rs#L1402 That last line should probably just be duplicated and also set RUSTDOCFLAGS, I think. We'll need to test (via CI is fine) that this works - if not, then we'll want to add a field as you've indicated and thread things through appropriately. |
Mark-Simulacrum
commented
Apr 23, 2020
Yeah, that looks like what I expected, thanks! r=me with CI passing and commits squashed. |
rust-highfive
commented
Apr 23, 2020
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
f4a4a8c to
0658259Compare@Mark-Simulacrum CI failed. I added a separate |
Mark-Simulacrum
commented
Apr 23, 2020
Thanks! @bors r+ |
bors
commented
Apr 23, 2020
📌 Commit 0658259 has been approved by |
…=Mark-Simulacrum Set `--cfg bootstrap` for stage0 rustdoc Resolvesrust-lang#71455. With this patch, running `./x.py doc --stage 0 src/libstd` with a clean `build` dir successfully outputs docs for `core`, `alloc` and `std` in under a minute. This kind of turnaround for viewing small changes to the standard library documentation is quite nice, and I think we should endeavour to keep it working. I'm not sure how involved that would be though. r? @Mark-Simulacrum
Dylan-DPC-zz
commented
Apr 24, 2020
fails in rollup @bors r- |
Weird. This is a failing stage2 WDYT @Mark-Simulacrum? |
Mark-Simulacrum
commented
Apr 24, 2020
We can probably add a bit of code to not set the RUSTDOCFLAGS and RUSTFLAGS variables if they're empty? (I believe they should be outside stage 0). |
ecstatic-morse
commented
Apr 24, 2020
That would also work and seems like a good idea independently. However, if we only do that, the first person who wants to add a flag to stage2 rustdoc will run into this problem again. I'm going to submit a |
Mark-Simulacrum
commented
Apr 24, 2020
@bors r+ rollup=never (in case we missed anything again) |
bors
commented
Apr 24, 2020
📌 Commit 08c8996 has been approved by |
Dylan-DPC-zz
commented
Apr 24, 2020
@bors p=1 |
bors
commented
Apr 25, 2020
bors
commented
Apr 25, 2020
☀️ Test successful - checks-azure |
Clear `RUSTDOCFLAGS` before running tests It turns out that this test will fail if `RUSTDOCFLAGS` is set in the test runner. This was found in rust-lang/rust#71458 (comment) when that PR attempted to set the proper `RUSTDOCFLAGS` to enable `./x.py doc --stage 0 src/libstd`. Run the test with no `RUSTDOCFLAGS` so that the config file always gets used.
…Mark-Simulacrum Direct contributors to try stage 0 rustdoc first After rust-lang#71458, `./x.py doc --stage 0 src/libstd` is (empirically) able to build the standard library docs using the `rustdoc` packaged with the bootstrap compiler. This means that new contributors don't need to build the compiler to locally inspect small documentation fixes. This was a roadblock for me when I first started contributing to rust and something that still regularly annoys people. We should recommend that contributors give bootstrap `rustdoc` a try before building the whole compiler.
Resolves#71455.
With this patch, running
./x.py doc --stage 0 src/libstdwith a cleanbuilddir successfully outputs docs forcore,allocandstdin under a minute. This kind of turnaround for viewing small changes to the standard library documentation is quite nice, and I think we should endeavour to keep it working. I'm not sure how involved that would be though.r? @Mark-Simulacrum