Fix, simplify, and document doc meta finalize mode - #159473
Conversation
|
r? @folkertdev rustbot has assigned @folkertdev. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? @camelid |
|
|
Since we're getting rid of the ability to do finalize and document at the same time, we can't actually do this in the rustdoc-html test build system and need to do it this way instead.
Co-authored-by: Noah Lev <37223377+camelid@users.noreply.github.com>
Co-authored-by: Noah Lev <37223377+camelid@users.noreply.github.com>
9e2125b to
d0fec14
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| let config = core::create_config( | ||
| Input::Str { | ||
| name: rustc_span::FileName::Custom(String::new()), | ||
| input: String::new(), | ||
| }, | ||
| options, | ||
| &render_options, | ||
| ); | ||
| return wrap_return( | ||
| dcx, | ||
| rustc_span::create_session_globals_then(options.edition, &[], None, || { | ||
| run_merge_finalize(render_options) | ||
| interface::run_compiler(config, |compiler| { | ||
| run_merge_finalize(render_options, compiler) |
There was a problem hiding this comment.
Ditto here, but getting rid of the fake Input::Str is harder, and this seems less bad than making a fake crate and TyCtxt. So fine to just leave it.
| If this parameter is supplied but `--read-doc-meta-dir` isn't, it runs in *intermediate mode*: | ||
| some pages may be written to the output dir, but there is a lot of functionality that won't work | ||
| until rustdoc is run in *finalize mode*. | ||
| When `--write-doc-meta-dir` is supplied, rustdoc will write the crate's shared metadata to |
There was a problem hiding this comment.
Probably not the right question for this PR, and I haven't read the implementation here, though I am curious:
- How does this interact with
--out-dir. I guess--out-diris ignored here? - How does this interact with all those
--emitfiles (w/ or w/o--out-dir? Where will those files be emitted?
There was a problem hiding this comment.
Context: I'd like to pass --emit=dep-info without specifying the full (absolute) path for those dep-info files. Because of this issue #159743 we cannot specify full path, and currently blocks rust-lang/cargo#17020.
(That said, it is a very Cargo specific issue I feel like)
There was a problem hiding this comment.
The --out-dir is still used as the path for --emit files. --write-doc-meta-dir doesn't pay attention to --out-dir.
There was a problem hiding this comment.
I see. So eventually if individual rustdoc doesn't need to emit html contents, cargo then can use --emit to control dep-info emission location exclusively. Thanks!
|
We're also missing the root-level |
|
Good catch! settings.html and help.html are moved, so they get generated at finalize now. |
This comment has been minimized.
This comment has been minimized.
23fae6c to
5f940df
Compare
|
Have we specified the behavior of rustdoc when two different invocations use the same |
Good point. I've added a mention of this to the unstable book. |
I asked mostly because I wonder if we should forbid/not support this use case. Otherwise we need to support reading multiple crates' metadata from a single flag's metadata directory. It might force us into adding extra structure to our metadata directories to make sure that different crates' entries don't clash. |
|
Thanks! @bors r+ |
…uwer Rollup of 12 pull requests Successful merges: - #159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests) - #159029 (rustc_llvm: Emit module summaries when using -Clto=fat) - #160574 (Update rustc-perf submodule) - #154585 (treat no_mangle_generic_items as hard error instead of lint warning) - #159473 (Fix, simplify, and document doc meta finalize mode) - #157489 (Add CoerceShared field-wise reborrow WF checks) - #160532 (Add Enzyme bugfix to support rust+llvm23) - #160545 (Reorder the methods in `#[rustc_must_implement_one_of]`) - #160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`") - #160566 (Re-enable bool indexing assembly test for LLVM 23) - #160569 (Remove `OnDuplicate::Custom`) - #160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
Rollup merge of #159473 - notriddle:rename-parts-to-dep-meta, r=camelid Fix, simplify, and document doc meta finalize mode Follow up #159415 (comment) Get rid of the mode where you can finalize the CCI and generate more docs at the same time. It isn't used in Cargo, and probably won't be used elsewhere? Fixes a bug where the crate index, settings page, and help page aren’t generated at finalize time. Update documentation. Move CCI tests to run-make, so that we can test the finalize step’s CLI.
…uwer Rollup of 12 pull requests Successful merges: - rust-lang/rust#159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests) - rust-lang/rust#159029 (rustc_llvm: Emit module summaries when using -Clto=fat) - rust-lang/rust#160574 (Update rustc-perf submodule) - rust-lang/rust#154585 (treat no_mangle_generic_items as hard error instead of lint warning) - rust-lang/rust#159473 (Fix, simplify, and document doc meta finalize mode) - rust-lang/rust#157489 (Add CoerceShared field-wise reborrow WF checks) - rust-lang/rust#160532 (Add Enzyme bugfix to support rust+llvm23) - rust-lang/rust#160545 (Reorder the methods in `#[rustc_must_implement_one_of]`) - rust-lang/rust#160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`") - rust-lang/rust#160566 (Re-enable bool indexing assembly test for LLVM 23) - rust-lang/rust#160569 (Remove `OnDuplicate::Custom`) - rust-lang/rust#160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
…uwer Rollup of 12 pull requests Successful merges: - rust-lang/rust#159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests) - rust-lang/rust#159029 (rustc_llvm: Emit module summaries when using -Clto=fat) - rust-lang/rust#160574 (Update rustc-perf submodule) - rust-lang/rust#154585 (treat no_mangle_generic_items as hard error instead of lint warning) - rust-lang/rust#159473 (Fix, simplify, and document doc meta finalize mode) - rust-lang/rust#157489 (Add CoerceShared field-wise reborrow WF checks) - rust-lang/rust#160532 (Add Enzyme bugfix to support rust+llvm23) - rust-lang/rust#160545 (Reorder the methods in `#[rustc_must_implement_one_of]`) - rust-lang/rust#160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`") - rust-lang/rust#160566 (Re-enable bool indexing assembly test for LLVM 23) - rust-lang/rust#160569 (Remove `OnDuplicate::Custom`) - rust-lang/rust#160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
View all comments
Follow up #159415 (comment)
Get rid of the mode where you can finalize the CCI and generate more docs at the same time. It isn't used in Cargo, and probably won't be used elsewhere?
Fixes a bug where the crate index, settings page, and help page aren’t generated at finalize time.
Update documentation.
Move CCI tests to run-make, so that we can test the finalize step’s CLI.