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
feat: rustdoc depinfo rebuild detection via -Zrustdoc-depinfo (#15359)
### What does this PR try to resolve?
This leverages the unstable `--emit=depinfo` option from rustdoc,
so that rustdoc invocation rebuild can be better tracked
without traversing the entire directory.
Some design decisions made in the current implementation:
* Rustdoc's depinfo doesn't and shouldn't emit to `target/doc`,
as the directory is considered part of the final artifact directory.
In regard to that, we specify the dep-info output path to
the fingerprint directory of rustdoc invocation.
It looks like this
`target/debug/.fingerprint/serde-12d29d32b3b8b38f/doc-lib-serde.d`.
* We also start supporting `-Zchecksum-freshness` as a side effect.
Could make it a separate PR if desired.
* `-Zbinary-dep-depinfo` is not enabled along with this,
since doc generations don't really require any binary dependencies.
### How should we test and review this PR?
The tests added has covered these cases:
* target src outside package root, e.g., `lib.path = "../lib.rs"`
* `#[doc = include_str!("../outside/pkgroot")]`
* `#[path = "../outside/pkgroot"]`
* `env!`
### Additional information
Fixes#12266Closes#15205
Copy file name to clipboardExpand all lines: src/doc/src/reference/unstable.md
+9
Original file line number
Diff line number
Diff line change
@@ -98,6 +98,7 @@ Each new feature described below should explain how to use it.
98
98
*[rustdoc-map](#rustdoc-map) --- Provides mappings for documentation to link to external sites like [docs.rs](https://docs.rs/).
99
99
*[scrape-examples](#scrape-examples) --- Shows examples within documentation.
100
100
*[output-format](#output-format-for-rustdoc) --- Allows documentation to also be emitted in the experimental [JSON format](https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc_json_types/).
101
+
*[rustdoc-depinfo](#rustdoc-depinfo) --- Use dep-info files in rustdoc rebuild detection.
101
102
*`Cargo.toml` extensions
102
103
*[Profile `rustflags` option](#profile-rustflags-option) --- Passed directly to rustc.
103
104
*[codegen-backend](#codegen-backend) --- Select the codegen backend used by rustc.
0 commit comments