fix: Pass rustdoc flags to final CCI merge step - #17269
Conversation
|
I need to figure out how to test this locally in bootstrap to make sure it fixes the issue in practice. |
|
You can build Cargo and then tell bootstrap to use that local Cargo using |
There was a problem hiding this comment.
BTW, this is listed as an unresolved question in #16306
- Should all RUSTDOCFLAGS apply to rustdoc --merge=finalize call?
- Some probably only need to pass to the --merge=finalize invocation, like --extend-css?
Could any rustdoc expert help walk through rustdoc options and figure out whether it is safe to unconditionally pass RUSTDOCFLAGS to both? Is there any flag you only want to pass to individual invocations or merge invocations?
There was a problem hiding this comment.
It seems like the simplest option is to pass all of the options to both, while having rustdoc ignore the options that are inapplicable. Since we want to leave the option open to defer all of the HTML generation to the finalize step (we don't do that right now), we need to pass all the HTML-related options to the finalize step.
There was a problem hiding this comment.
This sounds pretty convenient to Cargo.
However, from rustdoc's point of view, what if some of the options we mark as inapplicable today, may be applicable/useful in the future. If we change the behavior for ignore to apply, would it be a breaking change in rustdoc? Would it be better to just reject incompatible options in the first place? We might want to consider what doors gonna be closed if we do the ignoring way.
Random idea: Cargo could possibly have an unstable feature for bootstrap accepting RUSTDOC_FINALIZE_FLAGS (bad name) as a workaround. Eventually we would love to see a better interface of course.
There was a problem hiding this comment.
I think like @notriddle said, the finalize step should have full knowledge about how all the crates were documented (i.e. what rustdoc flags they received). Semantically the finalize step is equivalent to the same logic placed at the end of each crate's documentation run, but for performance reasons we want to just do it once.
There was a problem hiding this comment.
There are a lot of flags, like --theme (and --resource-suffix) that need to be the same across all rustdoc runs in the workspace. Otherwise, you get broken output.
We would like to take those steps and freely move them between phases without breaking things. So we don’t just want to reject every flag that we currently ignore, because we might use it later.
Crate-specific flags don’t apply, but they’re crate-specific, so you can’t put them in RUSTDOCFLAGS anyway.
There was a problem hiding this comment.
Makes sense. Thanks for the clarification!
b654c22 to
b3d2500
Compare
There was a problem hiding this comment.
Do you mind cleaning up commits to what you want to present them?
(like following commit structure in https://epage.github.io/dev/pr-style/)
|
Sure, just left them like this for review. Will clean up now. |
b605273 to
547eb2a
Compare
Cargo wasn't passing the `--resource-suffix` to the final merge step, breaking the filename for the search index in rust-lang/rust (and probably many other use cases). In fact, Cargo wasn't passing the RUSTDOCFLAGS at all. This commit changes Cargo to pass the same flags to the final merge invocation as to each crate's rustdoc invocation. This conflates flags for two somewhat different things, but we already share the same flags across all crates so I think sharing them with the merge makes sense.
547eb2a to
bbb7313
Compare
Update cargo submodule ## src/tools/cargo 23 commits in 3efb1f477e99b42974b982d939fd100303cdf7db..7c83d4cc0953b81d823e47d640c64da9b8bd4fac 2026-07-17 23:53:19 +0000 to 2026-07-29 21:34:53 +0000 - fix: Pass rustdoc flags to final CCI merge step (rust-lang/cargo#17269) - Reworked how we enable the new build-dir layout on nightly (rust-lang/cargo#17272) - Allow setting `-Zembed-metadata` value from the config (rust-lang/cargo#17266) - fix(cli): don't panic during completions when rustup is unavailable (rust-lang/cargo#17263) - docs(workspace): add recommended structure to members field (rust-lang/cargo#17166) - Update cargo-fetch.md to remove cargo-prefetch reference (rust-lang/cargo#16568) - chore: bump to `libgit2-sys@0.18.7+1.9.6` (rust-lang/cargo#17259) - Enable build-dir layout v2 on nightly by default (rust-lang/cargo#17258) - fix(path): clarify error message when path dependency has wrong package (rust-lang/cargo#16927) - fix(toml): warn on hyphenated lint names and duplicates (rust-lang/cargo#17051) - fix(test): gate trim-paths tests on split debuginfo support (rust-lang/cargo#17256) - test(git): Explicitly test for git injection attacks (rust-lang/cargo#17253) - fix(git): Suggest libgit2 if git-cli fails (rust-lang/cargo#17252) - fix(diag): bound transitive unused dependency traversal (rust-lang/cargo#17251) - fix(git): Hide git fetch output without progress (rust-lang/cargo#17243) - revert(lint): Remove `new_implicit_minimum_version_req` (rust-lang/cargo#16321) (rust-lang/cargo#17249) - fix: Add haiku's dylib path (rust-lang/cargo#17248) - Zsh completion: Add `-p` and `--package` flags for `cargo add` (rust-lang/cargo#17247) - refactor(source): Clarify the name of the remote git registry (rust-lang/cargo#17240) - fix(timings): only report units the job queue actually ran (rust-lang/cargo#17238) - Do not include proc-macro deps in rustc search path args (rust-lang/cargo#17236) - chore(deps): update cargo-semver-checks to v0.49.0 (rust-lang/cargo#17237) - rustdoc: rename the doc parts metadata params (rust-lang/cargo#17234) ## src/tools/rustc-perf 12 commits in 0508bdcd37152b28c39b6752828683cdd3f128b5..74ecbcdf88411937a6e39baf2779948565dfd388 2026-07-15 10:20:27 +0000 to 2026-07-27 15:02:48 +0000 - feat: support `@argfile` for rustc-fake (rust-lang/rustc-perf#2509) - Download Clippy when a Clippy profile is requested (rust-lang/rustc-perf#2508) - Add early check for missing rustdoc/clippy in a toolchain (rust-lang/rustc-perf#2507) - Add 2026-07-21 triage (rust-lang/rustc-perf#2506) - use stable extract_if: since 1.87 (rust-lang/rustc-perf#2191) - Update GitHub Actions (rust-lang/rustc-perf#2460) - Update dependency @types/msgpack-lite to v0.1.12 (rust-lang/rustc-perf#2439) - Add 30 day history link to artifact size tab on the compare page (rust-lang/rustc-perf#2505) - Fix selecting color for the bootstrap chart on the toolchain page (rust-lang/rustc-perf#2504) - Add artifact size history chart to toolchain page (rust-lang/rustc-perf#2501) - Parallel frontend compiler support (perf backend only) (rust-lang/rustc-perf#2491) - Run benchmark smoke test for all profiles on Windows on CI (rust-lang/rustc-perf#2503)
Update cargo submodule ## src/tools/cargo 23 commits in 3efb1f477e99b42974b982d939fd100303cdf7db..7c83d4cc0953b81d823e47d640c64da9b8bd4fac 2026-07-17 23:53:19 +0000 to 2026-07-29 21:34:53 +0000 - fix: Pass rustdoc flags to final CCI merge step (rust-lang/cargo#17269) - Reworked how we enable the new build-dir layout on nightly (rust-lang/cargo#17272) - Allow setting `-Zembed-metadata` value from the config (rust-lang/cargo#17266) - fix(cli): don't panic during completions when rustup is unavailable (rust-lang/cargo#17263) - docs(workspace): add recommended structure to members field (rust-lang/cargo#17166) - Update cargo-fetch.md to remove cargo-prefetch reference (rust-lang/cargo#16568) - chore: bump to `libgit2-sys@0.18.7+1.9.6` (rust-lang/cargo#17259) - Enable build-dir layout v2 on nightly by default (rust-lang/cargo#17258) - fix(path): clarify error message when path dependency has wrong package (rust-lang/cargo#16927) - fix(toml): warn on hyphenated lint names and duplicates (rust-lang/cargo#17051) - fix(test): gate trim-paths tests on split debuginfo support (rust-lang/cargo#17256) - test(git): Explicitly test for git injection attacks (rust-lang/cargo#17253) - fix(git): Suggest libgit2 if git-cli fails (rust-lang/cargo#17252) - fix(diag): bound transitive unused dependency traversal (rust-lang/cargo#17251) - fix(git): Hide git fetch output without progress (rust-lang/cargo#17243) - revert(lint): Remove `new_implicit_minimum_version_req` (rust-lang/cargo#16321) (rust-lang/cargo#17249) - fix: Add haiku's dylib path (rust-lang/cargo#17248) - Zsh completion: Add `-p` and `--package` flags for `cargo add` (rust-lang/cargo#17247) - refactor(source): Clarify the name of the remote git registry (rust-lang/cargo#17240) - fix(timings): only report units the job queue actually ran (rust-lang/cargo#17238) - Do not include proc-macro deps in rustc search path args (rust-lang/cargo#17236) - chore(deps): update cargo-semver-checks to v0.49.0 (rust-lang/cargo#17237) - rustdoc: rename the doc parts metadata params (rust-lang/cargo#17234) ## src/tools/rustc-perf 12 commits in 0508bdcd37152b28c39b6752828683cdd3f128b5..74ecbcdf88411937a6e39baf2779948565dfd388 2026-07-15 10:20:27 +0000 to 2026-07-27 15:02:48 +0000 - feat: support `@argfile` for rustc-fake (rust-lang/rustc-perf#2509) - Download Clippy when a Clippy profile is requested (rust-lang/rustc-perf#2508) - Add early check for missing rustdoc/clippy in a toolchain (rust-lang/rustc-perf#2507) - Add 2026-07-21 triage (rust-lang/rustc-perf#2506) - use stable extract_if: since 1.87 (rust-lang/rustc-perf#2191) - Update GitHub Actions (rust-lang/rustc-perf#2460) - Update dependency @types/msgpack-lite to v0.1.12 (rust-lang/rustc-perf#2439) - Add 30 day history link to artifact size tab on the compare page (rust-lang/rustc-perf#2505) - Fix selecting color for the bootstrap chart on the toolchain page (rust-lang/rustc-perf#2504) - Add artifact size history chart to toolchain page (rust-lang/rustc-perf#2501) - Parallel frontend compiler support (perf backend only) (rust-lang/rustc-perf#2491) - Run benchmark smoke test for all profiles on Windows on CI (rust-lang/rustc-perf#2503)
View all comments
Cargo wasn't passing the
--resource-suffixto the final merge step,breaking the filename for the search index in rust-lang/rust (and
probably many other use cases). In fact, Cargo wasn't passing the
RUSTDOCFLAGS at all. This commit changes Cargo to pass the same flags to
the final merge invocation as to each crate's rustdoc invocation. This
conflates flags for two somewhat different things, but we already share
the same flags across all crates so I think sharing them with the merge
makes sense.
LLM disclaimer: This change was mostly generated using an LLM, though the commit messages are handwritten.
r? @weihanglo