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

Set --cfg bootstrap for stage0 rustdoc #71458

Merged
merged 2 commits into from
Apr 25, 2020

Conversation

ecstatic-morse
Copy link
Contributor

@ecstatic-morse ecstatic-morse commented Apr 23, 2020

Resolves #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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 23, 2020
@Mark-Simulacrum
Copy link
Member

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
Copy link
Contributor Author

@Mark-Simulacrum can you be more specific about what you want? The only reference to RUSTFLAGS_BOOTSTRAP is on a builder called Rustflags, which is a field of the Cargo builder. Do you want me to add a rustdocflags field to the Cargo struct?

@ecstatic-morse
Copy link
Contributor Author

I'm gonna assume you want something like 7a20bc6.

@Mark-Simulacrum
Copy link
Member

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
Copy link
Member

Yeah, that looks like what I expected, thanks!

r=me with CI passing and commits squashed.

@rust-highfive
Copy link
Collaborator

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.
2020-04-23T16:02:25.9588612Z ========================== Starting Command Output ===========================
2020-04-23T16:02:25.9593291Z [command]/bin/bash --noprofile --norc /home/vsts/work/_temp/3a71f0a2-5d1f-4112-b960-2a746e99c7f5.sh
2020-04-23T16:02:25.9593559Z 
2020-04-23T16:02:25.9599596Z ##[section]Finishing: Disable git automatic line ending conversion
2020-04-23T16:02:25.9621500Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71458/merge to s
2020-04-23T16:02:25.9625253Z Task         : Get sources
2020-04-23T16:02:25.9625604Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-23T16:02:25.9625887Z Version      : 1.0.0
2020-04-23T16:02:25.9626081Z Author       : Microsoft
---
2020-04-23T16:02:27.1385161Z ##[command]git remote add origin https://github.com/rust-lang/rust
2020-04-23T16:02:27.1390956Z ##[command]git config gc.auto 0
2020-04-23T16:02:27.1396589Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2020-04-23T16:02:27.1400527Z ##[command]git config --get-all http.proxy
2020-04-23T16:02:27.1407429Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/71458/merge:refs/remotes/pull/71458/merge
---
2020-04-23T16:04:55.6836866Z  ---> 318032b5f0e2
2020-04-23T16:04:55.6838635Z Step 5/8 : ENV RUST_CONFIGURE_ARGS       --build=x86_64-unknown-linux-gnu       --llvm-root=/usr/lib/llvm-8       --enable-llvm-link-shared       --set rust.thin-lto-import-instr-limit=10
2020-04-23T16:04:55.6840149Z  ---> Using cache
2020-04-23T16:04:55.6841067Z  ---> d44a858fd1ce
2020-04-23T16:04:55.6843130Z Step 6/8 : ENV SCRIPT python2.7 ../x.py test --exclude src/tools/tidy &&            python2.7 ../x.py test src/test/mir-opt --pass=build                                   --target=armv5te-unknown-linux-gnueabi &&            python2.7 ../x.py test src/tools/tidy
2020-04-23T16:04:55.6845781Z  ---> 58b910f50f5a
2020-04-23T16:04:55.6846184Z Step 7/8 : ENV NO_DEBUG_ASSERTIONS=1
2020-04-23T16:04:55.6846690Z  ---> Using cache
2020-04-23T16:04:55.6847174Z  ---> ee7702aadba1
---
2020-04-23T16:04:55.7241214Z Looks like docker image is the same as before, not uploading
2020-04-23T16:05:02.4888099Z [CI_JOB_NAME=x86_64-gnu-llvm-8]
2020-04-23T16:05:02.5246139Z [CI_JOB_NAME=x86_64-gnu-llvm-8]
2020-04-23T16:05:02.5277828Z == clock drift check ==
2020-04-23T16:05:02.5286587Z   local time: Thu Apr 23 16:05:02 UTC 2020
2020-04-23T16:05:02.6041651Z   network time: Thu, 23 Apr 2020 16:05:02 GMT
2020-04-23T16:05:02.6066561Z Starting sccache server...
2020-04-23T16:05:02.6992416Z configure: processing command line
2020-04-23T16:05:02.6992663Z configure: 
2020-04-23T16:05:02.6993567Z configure: rust.dist-src        := False
---
2020-04-23T16:10:52.7833336Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-23T16:10:54.4032842Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-23T16:10:56.1319345Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-23T16:10:58.8445013Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-23T16:11:07.4154132Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-23T16:11:12.1515822Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-23T16:11:17.1102587Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-23T16:11:21.8993555Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-23T16:11:30.6561511Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-23T16:36:00.1205246Z    Compiling rustc_feature v0.0.0 (/checkout/src/librustc_feature)
2020-04-23T16:36:01.9168583Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2020-04-23T16:36:03.8972595Z    Compiling rustc_ast_pretty v0.0.0 (/checkout/src/librustc_ast_pretty)
2020-04-23T16:36:07.0114072Z    Compiling rustc_hir v0.0.0 (/checkout/src/librustc_hir)
2020-04-23T16:36:15.2752240Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-23T16:36:21.2220354Z    Compiling rustc_hir_pretty v0.0.0 (/checkout/src/librustc_hir_pretty)
2020-04-23T16:36:26.4805912Z    Compiling rustc_attr v0.0.0 (/checkout/src/librustc_attr)
2020-04-23T16:36:31.3641984Z    Compiling rustc_parse v0.0.0 (/checkout/src/librustc_parse)
2020-04-23T16:36:38.9102571Z    Compiling rustc_ast_lowering v0.0.0 (/checkout/src/librustc_ast_lowering)
---
2020-04-23T17:01:22.2846556Z .................................................................................................... 1700/9917
2020-04-23T17:01:26.6442441Z .................................................................................................... 1800/9917
2020-04-23T17:01:35.2985112Z .................................................................................................... 1900/9917
2020-04-23T17:01:43.7356540Z .....i.............................................................................................. 2000/9917
2020-04-23T17:01:50.2012100Z ...............................................................................................iiiii 2100/9917
2020-04-23T17:02:10.8384132Z .................................................................................................... 2300/9917
2020-04-23T17:02:13.1504604Z .................................................................................................... 2400/9917
2020-04-23T17:02:15.4875008Z .................................................................................................... 2500/9917
2020-04-23T17:02:21.3157548Z .................................................................................................... 2600/9917
---
2020-04-23T17:05:24.0912215Z .................................................................................................... 5100/9917
2020-04-23T17:05:31.3864157Z .................................................................................................... 5200/9917
2020-04-23T17:05:35.9809195Z ..................i................................................................................. 5300/9917
2020-04-23T17:05:46.1802951Z ........i........................................................................................... 5400/9917
2020-04-23T17:05:51.7839888Z ........ii.ii........i...i.......................................................................... 5500/9917
2020-04-23T17:05:59.5921555Z .......................................................i............................................ 5700/9917
2020-04-23T17:06:08.8090145Z ........................................................................................ii.......... 5800/9917
2020-04-23T17:06:15.8006326Z ...........................i........................................................................ 5900/9917
2020-04-23T17:06:21.3083212Z .................................................................................................... 6000/9917
2020-04-23T17:06:21.3083212Z .................................................................................................... 6000/9917
2020-04-23T17:06:32.4829712Z .................................................................................................... 6100/9917
2020-04-23T17:06:42.4949898Z .....................ii...i..ii...........i......................................................... 6200/9917
2020-04-23T17:06:58.8856404Z .................................................................................................... 6400/9917
2020-04-23T17:07:06.0233697Z .................................................................................................... 6500/9917
2020-04-23T17:07:06.0233697Z .................................................................................................... 6500/9917
2020-04-23T17:07:19.0097576Z ...................................................i..ii............................................ 6600/9917
2020-04-23T17:07:42.9320181Z .................................................................................................... 6800/9917
2020-04-23T17:07:45.4302095Z ....................................................i............................................... 6900/9917
2020-04-23T17:07:47.4913165Z .................................................................................................... 7000/9917
2020-04-23T17:07:49.6272394Z ............................................................................................i....... 7100/9917
---
2020-04-23T17:09:32.0108067Z .................................................................................................... 7900/9917
2020-04-23T17:09:38.0282376Z .................................................................................................... 8000/9917
2020-04-23T17:09:44.5609860Z ...........................................................i........................................ 8100/9917
2020-04-23T17:09:54.4526329Z .................................................................................................... 8200/9917
2020-04-23T17:10:00.1506714Z ........iiiiii.iiiii.i.............................................................................. 8300/9917
2020-04-23T17:10:14.1496578Z .................................................................................................... 8500/9917
2020-04-23T17:10:21.8371550Z .................................................................................................... 8600/9917
2020-04-23T17:10:35.6605706Z .................................................................................................... 8700/9917
2020-04-23T17:10:42.3016206Z .................................................................................................... 8800/9917
---
2020-04-23T17:13:03.5776990Z Suite("src/test/codegen") not skipped for "bootstrap::test::Codegen" -- not in ["src/tools/tidy"]
2020-04-23T17:13:03.5975800Z Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-23T17:13:03.8091751Z 
2020-04-23T17:13:03.8092180Z running 186 tests
2020-04-23T17:13:06.7913891Z iiii......i.............ii.i..........i.............................i..i..................i....i.... 100/186
2020-04-23T17:13:09.4622727Z ........i.i.i...iii..iiiiiiiiiiiiiiii.......................iii...............ii......
2020-04-23T17:13:09.4628468Z 
2020-04-23T17:13:09.4633074Z  finished in 5.864
2020-04-23T17:13:09.4637278Z Suite("src/test/codegen-units") not skipped for "bootstrap::test::CodegenUnits" -- not in ["src/tools/tidy"]
2020-04-23T17:13:09.4816378Z Check compiletest suite=codegen-units mode=codegen-units (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
2020-04-23T17:13:11.6737591Z Suite("src/test/assembly") not skipped for "bootstrap::test::Assembly" -- not in ["src/tools/tidy"]
2020-04-23T17:13:11.6941637Z Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-23T17:13:11.8553948Z 
2020-04-23T17:13:11.8555794Z running 9 tests
2020-04-23T17:13:11.8556799Z iiiiiiiii
2020-04-23T17:13:11.8557862Z 
2020-04-23T17:13:11.8561965Z  finished in 0.162
2020-04-23T17:13:11.8569068Z Suite("src/test/incremental") not skipped for "bootstrap::test::Incremental" -- not in ["src/tools/tidy"]
2020-04-23T17:13:11.8760324Z Check compiletest suite=incremental mode=incremental (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
2020-04-23T17:13:32.7743734Z Suite("src/test/debuginfo") not skipped for "bootstrap::test::Debuginfo" -- not in ["src/tools/tidy"]
2020-04-23T17:13:32.8002393Z Check compiletest suite=debuginfo mode=debuginfo (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-23T17:13:32.9985562Z 
2020-04-23T17:13:32.9985953Z running 115 tests
2020-04-23T17:13:46.9752117Z iiiii..i.....i..i...i..i.i.i..i..i..ii....i.i....ii..........iiii.........i.....i..i.......ii.i.ii.. 100/115
2020-04-23T17:13:48.7594401Z ...iiii.....ii.
2020-04-23T17:13:48.7595538Z 
2020-04-23T17:13:48.7600936Z  finished in 15.960
2020-04-23T17:13:48.7605964Z Suite("src/test/ui-fulldeps") not skipped for "bootstrap::test::UiFullDeps" -- not in ["src/tools/tidy"]
2020-04-23T17:13:48.7609537Z Uplifting stage1 rustc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
2020-04-23T17:26:28.1392985Z 
2020-04-23T17:26:28.1399353Z    Doc-tests core
2020-04-23T17:26:33.2852224Z 
2020-04-23T17:26:33.2853610Z running 2499 tests
2020-04-23T17:26:40.7671265Z ......iiiii......................................................................................... 100/2499
2020-04-23T17:26:48.1775251Z ......................................................................................ii............ 200/2499
2020-04-23T17:27:05.2430297Z ......................i............................................................................. 400/2499
2020-04-23T17:27:13.6143938Z ............................................................................i..i..................ii 500/2499
2020-04-23T17:27:19.7417079Z ii.................................................................................................. 600/2499
2020-04-23T17:27:26.4971902Z .................................................................................................... 700/2499
---
2020-04-23T17:30:55.7240896Z 
2020-04-23T17:30:55.7241222Z running 1020 tests
2020-04-23T17:31:11.2697539Z i................................................................................................... 100/1020
2020-04-23T17:31:19.8258365Z .................................................................................................... 200/1020
2020-04-23T17:31:26.1526691Z ...................iii......i......i...i......i..................................................... 300/1020
2020-04-23T17:31:30.5704918Z .................................................................................................... 400/1020
2020-04-23T17:31:36.0544562Z ....................................................i....i......................................ii.. 500/1020
2020-04-23T17:31:47.0193553Z .................................................................................................... 700/1020
2020-04-23T17:31:47.0193553Z .................................................................................................... 700/1020
2020-04-23T17:31:52.4054137Z ..............................................iiii.................................................. 800/1020
2020-04-23T17:32:05.0705577Z .................................................................................................... 900/1020
2020-04-23T17:32:10.5948548Z ....................................................................iiii............................ 1000/1020
2020-04-23T17:32:11.7647097Z test result: ok. 1000 passed; 0 failed; 20 ignored; 0 measured; 0 filtered out
2020-04-23T17:32:11.7647570Z 
2020-04-23T17:32:11.7747878Z  finished in 154.044
2020-04-23T17:32:11.7755316Z Set({"src/libterm"}) not skipped for "bootstrap::test::Crate" -- not in ["src/tools/tidy"]
---
2020-04-23T17:35:32.5790811Z 
2020-04-23T17:35:32.5791222Z test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
2020-04-23T17:35:32.5791429Z 
2020-04-23T17:35:32.5850886Z  finished in 1.099
2020-04-23T17:35:32.5856665Z Set({"/checkout/src/librustc_query_system"}) not skipped for "bootstrap::test::CrateLibrustc" -- not in ["src/tools/tidy"]
2020-04-23T17:35:32.5877764Z Testing rustc_query_system stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2020-04-23T17:35:32.7990283Z    Compiling rustc_query_system v0.0.0 (/checkout/src/librustc_query_system)
2020-04-23T17:35:33.9705114Z      Running build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc_query_system-83347ed9ff950ca7
2020-04-23T17:35:33.9734178Z 
2020-04-23T17:35:33.9734651Z running 0 tests
2020-04-23T17:35:33.9734912Z 
---
2020-04-23T17:49:54.9976906Z 
2020-04-23T17:49:55.0260247Z error: Could not document `core`.
2020-04-23T17:49:55.0260475Z 
2020-04-23T17:49:55.0260609Z Caused by:
2020-04-23T17:49:55.0262896Z   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --edition=2018 --crate-type lib --crate-name core src/libcore/lib.rs --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/x86_64-unknown-linux-gnu/doc --error-format=json --json=diagnostic-rendered-ansi --markdown-css rust.css --markdown-no-toc --generate-redirect-pages -Z unstable-options --resource-suffix 1.44.0 --index-page /checkout/src/doc/index.md -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/release/deps -Zmacro-backtrace '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Wrust_2018_idioms -Wunused_lifetimes -Dwarnings -Cprefer-dynamic -Cllvm-args=-import-instr-limit=10 -Cbitcode-in-rlib=yes` (exit code: 1)
2020-04-23T17:49:55.0284890Z 
2020-04-23T17:49:55.0284890Z 
2020-04-23T17:49:55.0290778Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustdoc" "--target" "x86_64-unknown-linux-gnu" "-Zbinary-dep-depinfo" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libtest/Cargo.toml" "-p" "core" "--" "--markdown-css" "rust.css" "--markdown-no-toc" "--generate-redirect-pages" "-Z" "unstable-options" "--resource-suffix" "1.44.0" "--index-page" "/checkout/src/doc/index.md"
2020-04-23T17:49:55.0291926Z 
2020-04-23T17:49:55.0292015Z 
2020-04-23T17:49:55.0292836Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --exclude src/tools/tidy
2020-04-23T17:49:55.0293167Z Build completed unsuccessfully in 1:43:04
2020-04-23T17:49:55.0293167Z Build completed unsuccessfully in 1:43:04
2020-04-23T17:49:55.0351540Z == clock drift check ==
2020-04-23T17:49:55.0381057Z   local time: Thu Apr 23 17:49:55 UTC 2020
2020-04-23T17:49:55.1841396Z   network time: Thu, 23 Apr 2020 17:49:55 GMT
2020-04-23T17:49:56.0752040Z 
2020-04-23T17:49:56.0752040Z 
2020-04-23T17:49:56.0853090Z ##[error]Bash exited with code '1'.
2020-04-23T17:49:56.0883771Z ##[section]Finishing: Run build
2020-04-23T17:49:56.0939205Z ##[section]Starting: Checkout rust-lang/rust@refs/pull/71458/merge to s
2020-04-23T17:49:56.0944288Z Task         : Get sources
2020-04-23T17:49:56.0944614Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2020-04-23T17:49:56.0944922Z Version      : 1.0.0
2020-04-23T17:49:56.0945129Z Author       : Microsoft
2020-04-23T17:49:56.0945129Z Author       : Microsoft
2020-04-23T17:49:56.0945461Z Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2020-04-23T17:49:56.0946193Z ==============================================================================
2020-04-23T17:49:56.4417190Z Cleaning any cached credential from repository: rust-lang/rust (GitHub)
2020-04-23T17:49:56.4469749Z ##[section]Finishing: Checkout rust-lang/rust@refs/pull/71458/merge to s
2020-04-23T17:49:56.4570796Z Cleaning up task key
2020-04-23T17:49:56.4572099Z Start cleaning up orphan processes.
2020-04-23T17:49:56.4788744Z Terminate orphan process: pid (5155) (python)
2020-04-23T17:49:56.5025954Z ##[section]Finishing: Finalize Job

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 @rust-lang/infra. (Feature Requests)

@ecstatic-morse
Copy link
Contributor Author

ecstatic-morse commented Apr 23, 2020

@Mark-Simulacrum CI failed. I added a separate rustdocflags field, which is initialized with copy of rustflags before we start adding -Z flags to it.

@Mark-Simulacrum
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Apr 23, 2020

📌 Commit 0658259 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 23, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Apr 23, 2020
…=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
@Dylan-DPC-zz
Copy link

fails in rollup

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 24, 2020
@ecstatic-morse
Copy link
Contributor Author

ecstatic-morse commented Apr 24, 2020

Weird. This is a failing stage2 cargo test. I assume that the RUSTDOCFLAGS we set in this PR are overriding the ones that would be parsed from the config. I'm not really sure why cargo tests are using rustbuild. Presumably it's just a convenience to get to the rustdoc executable packaged with the bootstrap compiler? If that's the case, we can just clear RUSTDOCFLAGS before that test is run.

WDYT @Mark-Simulacrum?

failures:

---- rustdocflags::parses_config stdout ----
running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo doc -v`
thread 'rustdocflags::parses_config' panicked at '
Expected: execs
    but: expected to find:
[RUNNING] `rustdoc [..] --cfg foo[..]`

did not find in output:
 Documenting foo v0.0.1 (/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t1536/foo)
     Running `rustdoc --crate-type lib --crate-name foo src/lib.rs -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t1536/foo/target/doc --error-format=json --json=diagnostic-rendered-ansi -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t1536/foo/target/debug/deps`
    Finished dev [unoptimized + debuginfo] target(s) in 1.00s
', src/tools/cargo/crates/cargo-test-support/src/lib.rs:833:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    rustdocflags::parses_config

test result: FAILED. 1841 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

error: test failed, to rerun pass '--test testsuite'

@Mark-Simulacrum
Copy link
Member

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
Copy link
Contributor Author

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 cargo PR as well.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=never (in case we missed anything again)

@bors
Copy link
Contributor

bors commented Apr 24, 2020

📌 Commit 08c8996 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 24, 2020
@Dylan-DPC-zz
Copy link

@bors p=1

@bors
Copy link
Contributor

bors commented Apr 25, 2020

⌛ Testing commit 08c8996 with merge a58b1ed...

@bors
Copy link
Contributor

bors commented Apr 25, 2020

☀️ Test successful - checks-azure
Approved by: Mark-Simulacrum
Pushing a58b1ed to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 25, 2020
@bors bors merged commit a58b1ed into rust-lang:master Apr 25, 2020
bors added a commit to rust-lang/cargo that referenced this pull request Apr 27, 2020
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.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request May 4, 2020
…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.
@ecstatic-morse ecstatic-morse deleted the bootstrap-cfg-doc branch October 6, 2020 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set --cfg bootstrap for rustdoc when building docs with bootstrap compiler
5 participants