doc: don't use mergeable info and json together - #17336
Conversation
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
There was a problem hiding this comment.
Could you walk me through the failure rust-lang/rust#160724 (comment)?
I guess bootstrap pass -Zrustdoc-mergeable-info unconditionally when generating rustdoc JSON, but why?
There was a problem hiding this comment.
Here's the log output around where this is failing. The crash, and the failure, are in Cargo, not Rustdoc. https://triage.rust-lang.org/gha-logs/rust-lang/rust/92954202748#L2026-08-07T20:23:47.1415288Z
There was a problem hiding this comment.
It seems like bootstrap passes -Zrustdoc-mergeable-info to the JSON doc build because that's the same target it uses for HTML docs. https://github.com/rust-lang/rust/blob/49c80b5a0db8abd63315c04ff34f58629e388281/src/bootstrap/src/core/build_steps/doc.rs#L666-L670
| // html-non-static-files is required for keeping the original rustdoc emission | ||
| let mut arg = if build_runner.bcx.gctx.cli_unstable().rustdoc_mergeable_info { | ||
| let mut arg = if wants_json_output { | ||
| OsString::from("--emit=dep-info=") |
There was a problem hiding this comment.
There is an issue in rustdoc blocking this: rust-lang/rust#158869. I think this would produce zero JSON output with -Zrustdoc-depinfo.
A bit surprised we didn't have a test catching it.
There was a problem hiding this comment.
You're right. That's not working.
To fix it, I think rustdoc needs changed. It was already broken before, though, so can we keep going?
There was a problem hiding this comment.
Would you mind following C-TEST so the first commit serves as a repro. In the second commit, the git diff of the snapshot shows the bheavior change.
|
I wonder if Rustdoc should error if output-format json and mergeable info (ie read doc meta or write doc meta) are requested simultaneously. Although long term we'll want to use mergeable metadata with json too I imagine. |
|
None of them are blockers btw. Let me know if you want to address or we just merge as-is. |
It doesn't do anything, and Cargo doesn't do its fingerprint metadata correctly in this mode.
19e959a to
0b8ea94
Compare
Update cargo submodule 10 commits in b07e5a08651da80108eb65d7dc769ee04589f9bf..eb98b54bc9f3c74519f43d066cb3fd02ebc88df0 2026-08-07 21:51:16 +0000 to 2026-08-11 16:00:29 +0000 - feat(trim-paths): honor workspace prefix override from env (rust-lang/cargo#17349) - fix(clean): respect target with --doc (rust-lang/cargo#17322) - chore(renovate): Use a 3day minimum release age (rust-lang/cargo#17346) - test: Handle non-deterministic compilation order (rust-lang/cargo#17347) - docs(ref): Add missing config env variables (rust-lang/cargo#17345) - fix(trim-paths): workspace remap under -Zroot-dir (rust-lang/cargo#17337) - Fix funding link (rust-lang/cargo#17344) - fix(trim-paths): `/cargo/deps` fallback sources (rust-lang/cargo#17338) - doc: don't use mergeable info and json together (rust-lang/cargo#17336) - docs: document --output-format for cargo doc (rust-lang/cargo#17325)
It doesn't do anything, and Cargo doesn't do its fingerprint metadata correctly in this mode.
Fixes a bug we found while working on enabling this feature for the standard library: rust-lang/rust#160724 (comment)