Expand description

Module for generating dep-info files.

rustc generates a dep-info file with a .d extension at the same location of the output artifacts as a result of using --emit=dep-info. This dep-info file is a Makefile-like syntax that indicates the dependencies needed to build the artifact. Example:

/path/to/target/debug/deps/cargo-b6219d178925203d: src/bin/main.rs src/bin/cargo/cli.rs # … etc.

The fingerprint module has code to parse these files, and stores them as binary format in the fingerprint directory. These are used to quickly scan for any changed files.

On top of all this, Cargo emits its own dep-info files in the output directory. This is done for every “uplifted” artifact. These are intended to be used with external build systems so that they can detect if Cargo needs to be re-executed. It includes all the entries from the rustc dep-info file, and extends it with any rerun-if-changed entries from build scripts. It also includes sources from any path dependencies. Registry dependencies are not included under the assumption that changes to them can be detected via changes to Cargo.lock.

Functions

Save a .d dep-info file for the given unit.
wrap_path 🔒