Ed Page 7220445a9d
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 #12266
Closes #15205
2025-03-31 14:12:26 +00:00
..
2024-11-25 09:27:09 -06:00
2024-11-25 09:27:09 -06:00
2025-01-13 10:40:13 -06:00
2024-07-26 23:26:48 +08:00
2024-11-25 09:27:09 -06:00
2025-03-15 17:55:15 -05:00
2025-02-26 14:57:14 -06:00
2024-11-15 09:33:23 -06:00