Commit 7220445
authored
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 #15205File tree
6 files changed
+384
-15
lines changed- src
- cargo/core
- compiler
- fingerprint
- doc/src/reference
- tests/testsuite
- cargo/z_help
6 files changed
+384
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1494 | 1494 | | |
1495 | 1495 | | |
1496 | 1496 | | |
1497 | | - | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
1498 | 1500 | | |
1499 | 1501 | | |
1500 | 1502 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
766 | 779 | | |
767 | 780 | | |
768 | 781 | | |
| |||
838 | 851 | | |
839 | 852 | | |
840 | 853 | | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
841 | 868 | | |
842 | 869 | | |
843 | 870 | | |
| |||
903 | 930 | | |
904 | 931 | | |
905 | 932 | | |
| 933 | + | |
906 | 934 | | |
907 | 935 | | |
908 | 936 | | |
| |||
930 | 958 | | |
931 | 959 | | |
932 | 960 | | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
933 | 984 | | |
934 | 985 | | |
935 | 986 | | |
| |||
2012 | 2063 | | |
2013 | 2064 | | |
2014 | 2065 | | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
| 793 | + | |
793 | 794 | | |
794 | 795 | | |
795 | 796 | | |
| |||
1303 | 1304 | | |
1304 | 1305 | | |
1305 | 1306 | | |
| 1307 | + | |
1306 | 1308 | | |
1307 | 1309 | | |
1308 | 1310 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
1904 | 1905 | | |
1905 | 1906 | | |
1906 | 1907 | | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
1907 | 1916 | | |
1908 | 1917 | | |
1909 | 1918 | | |
| |||
Loading
0 commit comments