|
47 | 47 | //! reliable and reproducible builds at the cost of being complex, slow, and
|
48 | 48 | //! platform-dependent.
|
49 | 49 | //!
|
50 |
| -//! ## Fingerprints and Metadata |
| 50 | +//! ## Fingerprints and [`UnitHash`]s |
| 51 | +//! |
| 52 | +//! [`Metadata`] tracks several [`UnitHash`]s, including |
| 53 | +//! [`Metadata::unit_id`], [`Metadata::c_metadata`], and [`Metadata::c_extra_filename`]. |
| 54 | +//! See its documentation for more details. |
51 | 55 | //!
|
52 |
| -//! The [`Metadata`] hash is a hash added to the output filenames to isolate |
53 |
| -//! each unit. See its documentationfor more details. |
54 | 56 | //! NOTE: Not all output files are isolated via filename hashes (like dylibs).
|
55 | 57 | //! The fingerprint directory uses a hash, but sometimes units share the same
|
56 | 58 | //! fingerprint directory (when they don't have Metadata) so care should be
|
57 | 59 | //! taken to handle this!
|
58 | 60 | //!
|
59 |
| -//! Fingerprints and Metadata are similar, and track some of the same things. |
60 |
| -//! The Metadata contains information that is required to keep Units separate. |
| 61 | +//! Fingerprints and [`UnitHash`]s are similar, and track some of the same things. |
| 62 | +//! [`UnitHash`]s contains information that is required to keep Units separate. |
61 | 63 | //! The Fingerprint includes additional information that should cause a
|
62 | 64 | //! recompile, but it is desired to reuse the same filenames. A comparison
|
63 | 65 | //! of what is tracked:
|
64 | 66 | //!
|
65 |
| -//! Value | Fingerprint | Metadata |
66 |
| -//! -------------------------------------------|-------------|---------- |
67 |
| -//! rustc | ✓ | ✓ |
68 |
| -//! [`Profile`] | ✓ | ✓ |
69 |
| -//! `cargo rustc` extra args | ✓ | |
70 |
| -//! [`CompileMode`] | ✓ | ✓ |
71 |
| -//! Target Name | ✓ | ✓ |
72 |
| -//! `TargetKind` (bin/lib/etc.) | ✓ | ✓ |
73 |
| -//! Enabled Features | ✓ | ✓ |
74 |
| -//! Declared Features | ✓ | |
75 |
| -//! Immediate dependency’s hashes | ✓[^1] | ✓ |
76 |
| -//! [`CompileKind`] (host/target) | ✓ | ✓ |
77 |
| -//! `__CARGO_DEFAULT_LIB_METADATA`[^4] | | ✓ |
78 |
| -//! `package_id` | | ✓ |
79 |
| -//! authors, description, homepage, repo | ✓ | |
80 |
| -//! Target src path relative to ws | ✓ | |
81 |
| -//! Target flags (test/bench/for_host/edition) | ✓ | |
82 |
| -//! -C incremental=… flag | ✓ | |
83 |
| -//! mtime of sources | ✓[^3] | |
84 |
| -//! RUSTFLAGS/RUSTDOCFLAGS | ✓ | |
85 |
| -//! [`Lto`] flags | ✓ | ✓ |
86 |
| -//! config settings[^5] | ✓ | |
87 |
| -//! `is_std` | | ✓ |
88 |
| -//! `[lints]` table[^6] | ✓ | |
89 |
| -//! `[lints.rust.unexpected_cfgs.check-cfg]` | ✓ | |
| 67 | +//! Value | Fingerprint | `Metadata::unit_id` | `Metadata::c_metadata` | `Metadata::c_extra_filename` |
| 68 | +//! -------------------------------------------|-------------|---------------------|------------------------|---------- |
| 69 | +//! rustc | ✓ | ✓ | ✓ | ✓ |
| 70 | +//! [`Profile`] | ✓ | ✓ | ✓ | ✓ |
| 71 | +//! `cargo rustc` extra args | ✓ | | | |
| 72 | +//! [`CompileMode`] | ✓ | ✓ | ✓ | ✓ |
| 73 | +//! Target Name | ✓ | ✓ | ✓ | ✓ |
| 74 | +//! `TargetKind` (bin/lib/etc.) | ✓ | ✓ | ✓ | ✓ |
| 75 | +//! Enabled Features | ✓ | ✓ | ✓ | ✓ |
| 76 | +//! Declared Features | ✓ | | | |
| 77 | +//! Immediate dependency’s hashes | ✓[^1] | ✓ | ✓ | ✓ |
| 78 | +//! [`CompileKind`] (host/target) | ✓ | ✓ | ✓ | ✓ |
| 79 | +//! `__CARGO_DEFAULT_LIB_METADATA`[^4] | | ✓ | ✓ | ✓ |
| 80 | +//! `package_id` | | ✓ | ✓ | ✓ |
| 81 | +//! authors, description, homepage, repo | ✓ | | | |
| 82 | +//! Target src path relative to ws | ✓ | | | |
| 83 | +//! Target flags (test/bench/for_host/edition) | ✓ | | | |
| 84 | +//! -C incremental=… flag | ✓ | | | |
| 85 | +//! mtime of sources | ✓[^3] | | | |
| 86 | +//! RUSTFLAGS/RUSTDOCFLAGS | ✓ | | | |
| 87 | +//! [`Lto`] flags | ✓ | ✓ | ✓ | ✓ |
| 88 | +//! config settings[^5] | ✓ | | | |
| 89 | +//! `is_std` | | ✓ | ✓ | ✓ |
| 90 | +//! `[lints]` table[^6] | ✓ | | | |
| 91 | +//! `[lints.rust.unexpected_cfgs.check-cfg]` | ✓ | | | |
90 | 92 | //!
|
91 | 93 | //! [^1]: Build script and bin dependencies are not included.
|
92 | 94 | //!
|
|
348 | 350 | //!
|
349 | 351 | //! [`check_filesystem`]: Fingerprint::check_filesystem
|
350 | 352 | //! [`Metadata`]: crate::core::compiler::Metadata
|
| 353 | +//! [`Metadata::unit_id`]: crate::core::compiler::Metadata::unit_id |
| 354 | +//! [`Metadata::c_metadata`]: crate::core::compiler::Metadata::c_metadata |
| 355 | +//! [`Metadata::c_extra_filename`]: crate::core::compiler::Metadata::c_extra_filename |
| 356 | +//! [`UnitHash`]: crate::core::compiler::UnitHash |
351 | 357 | //! [`Profile`]: crate::core::profiles::Profile
|
352 | 358 | //! [`CompileMode`]: crate::core::compiler::CompileMode
|
353 | 359 | //! [`Lto`]: crate::core::compiler::Lto
|
|
0 commit comments