-
-
Notifications
You must be signed in to change notification settings - Fork 3k
doc: don't use mergeable info and json together #17336
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -871,6 +871,7 @@ fn prepare_rustdoc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResu | |
| let bcx = build_runner.bcx; | ||
| // script_metadata is not needed here, it is only for tests. | ||
| let mut rustdoc = build_runner.compilation.rustdoc_process(unit, None)?; | ||
| let wants_json_output = build_runner.bcx.build_config.intent.wants_doc_json_output(); | ||
| if unit.pkg.manifest().is_embedded() { | ||
| if !bcx.gctx.cli_unstable().script { | ||
| anyhow::bail!( | ||
|
|
@@ -889,7 +890,7 @@ fn prepare_rustdoc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResu | |
|
|
||
| unit.kind.add_target_arg(&mut rustdoc); | ||
|
|
||
| let doc_dir = if build_runner.bcx.build_config.intent.wants_doc_json_output() { | ||
| let doc_dir = if wants_json_output { | ||
| // Always use new layout for '--output-format=json'. | ||
| // In fix for https://github.com/rust-lang/cargo/issues/16291 | ||
|
|
||
|
|
@@ -908,7 +909,9 @@ fn prepare_rustdoc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResu | |
| if build_runner.bcx.gctx.cli_unstable().rustdoc_depinfo { | ||
| // html-static-files is required for keeping the shared styling resources | ||
| // 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=") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an issue in rustdoc blocking this: rust-lang/rust#158869. I think this would produce zero JSON output with A bit surprised we didn't have a test catching it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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? |
||
| } else if build_runner.bcx.gctx.cli_unstable().rustdoc_mergeable_info { | ||
| // toolchain resources are written at the end, at the same time as merging | ||
| OsString::from("--emit=html-non-static-files,dep-info=") | ||
| } else { | ||
|
|
@@ -921,12 +924,12 @@ fn prepare_rustdoc(build_runner: &BuildRunner<'_, '_>, unit: &Unit) -> CargoResu | |
| if build_runner.bcx.gctx.cli_unstable().checksum_freshness { | ||
| rustdoc.arg("-Z").arg("checksum-hash-algorithm=blake3"); | ||
| } | ||
| } else if build_runner.bcx.gctx.cli_unstable().rustdoc_mergeable_info { | ||
| } else if build_runner.bcx.gctx.cli_unstable().rustdoc_mergeable_info && !wants_json_output { | ||
| // toolchain resources are written at the end, at the same time as merging | ||
| rustdoc.arg("--emit=html-non-static-files"); | ||
| } | ||
|
|
||
| if build_runner.bcx.gctx.cli_unstable().rustdoc_mergeable_info { | ||
| if build_runner.bcx.gctx.cli_unstable().rustdoc_mergeable_info && !wants_json_output { | ||
| // write out mergeable data to be imported | ||
| rustdoc.arg("-Zunstable-options"); | ||
| let mut arg = OsString::from("--write-doc-meta-dir="); | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you walk me through the failure rust-lang/rust#160724 (comment)?
I guess bootstrap pass
-Zrustdoc-mergeable-infounconditionally when generating rustdoc JSON, but why?View changes since the review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like bootstrap passes
-Zrustdoc-mergeable-infoto 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