You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
x doc std unconditionally recompiles the standard library each time #103785
@LukeMathWalker this is a regression from #101799 - do you think you'll have time to follow up? I think we can either add a stamp file to avoid rebuilding, or find some other way to avoid removing the whole directory - maybe we can only remove/copy the .json files, rather than everything?
Ok, I confirmed that rustdoc only creates JSON files with --output-format json:
; RUSTDOCFLAGS='--output-format=json -Zunstable-options' cargo doc
Documenting inner v0.1.0 (/home/jnelson/rust-lang/test-rust)
Finished dev [unoptimized + debuginfo] target(s) in 0.50s
; ls target/doc
inner.json
So it should be enough to only copy .json files when passed --json, and only non-json files when it's not passed.
We should also add a test that x doc && x doc --json produces the same output in json-doc as x doc --json, to avoid a regression if rustdoc starts emitting JSON files in the default HTML format.
We should also add a test that x doc && x doc --json produces the same output in json-doc as x doc --json, to avoid a regression if rustdoc starts emitting JSON files in the default HTML format.
We can do this validation for doc dir, but I am not sure if this is possible for json-doc dir since each time json output changes. The layout of json context is getting change even if you don't change anyhing on the source code.
I print sha2 sums below to demonstrate the situation.
@ozkanonur thanks for investigating; sounds like we should report that as a separate bug in rustdoc. But for now it's ok if the files don't match exactly as long as the file names are the same between runs.
Activity
jyn514 commentedon Nov 5, 2022
Ok, I confirmed that rustdoc only creates JSON files with --output-format json:
So it should be enough to only copy .json files when passed --json, and only non-json files when it's not passed.
We should also add a test that
x doc && x doc --jsonproduces the same output in json-doc asx doc --json, to avoid a regression if rustdoc starts emitting JSON files in the default HTML format.LukeMathWalker commentedon Nov 6, 2022
I can't jump on it immediately, but I should be able to follow up in a couple of weeks 👍
onur-ozkan commentedon Nov 7, 2022
@rustbot claim
onur-ozkan commentedon Nov 8, 2022
We can do this validation for
docdir, but I am not sure if this is possible forjson-docdir since each time json output changes. The layout of json context is getting change even if you don't change anyhing on the source code.I print sha2 sums below to demonstrate the situation.
1st attempt:
2nd attempt right after the first attempt
The demonstration is from 391ba78
jyn514 commentedon Nov 8, 2022
@ozkanonur thanks for investigating; sounds like we should report that as a separate bug in rustdoc. But for now it's ok if the files don't match exactly as long as the file names are the same between runs.
Rollup merge of rust-lang#104286 - ozkanonur:fix-doc-bootstrap-recomp…
Rollup merge of rust-lang#108626 - ozkanonur:consistent-json-docs, r=…
Rollup merge of rust-lang#108626 - ozkanonur:consistent-json-docs, r=…