-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Set --cfg bootstrap
for stage0 rustdoc
#71458
Conversation
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. |
@Mark-Simulacrum can you be more specific about what you want? The only reference to |
431602b
to
7a20bc6
Compare
I'm gonna assume you want something like 7a20bc6. |
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. |
Yeah, that looks like what I expected, thanks! r=me with CI passing and commits squashed. |
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
0658259
Compare
@Mark-Simulacrum CI failed. I added a separate |
Thanks! @bors r+ |
📌 Commit 0658259 has been approved by |
…=Mark-Simulacrum Set `--cfg bootstrap` for stage0 rustdoc Resolves rust-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
fails in rollup @bors r- |
Weird. This is a failing stage2 WDYT @Mark-Simulacrum?
|
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). |
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 |
@bors r+ rollup=never (in case we missed anything again) |
📌 Commit 08c8996 has been approved by |
@bors p=1 |
☀️ 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/libstd
with a cleanbuild
dir successfully outputs docs forcore
,alloc
andstd
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