Function cargo::core::compiler::fingerprint::translate_dep_info

source ·
pub fn translate_dep_info(
    rustc_dep_info: &Path,
    cargo_dep_info: &Path,
    rustc_cwd: &Path,
    pkg_root: &Path,
    target_root: &Path,
    rustc_cmd: &ProcessBuilder,
    allow_package: bool,
) -> CargoResult<()>
Expand description

Parses the dep-info file coming out of rustc into a Cargo-specific format.

This function will parse rustc_dep_info as a makefile-style dep info to learn about the all files which a crate depends on. This is then re-serialized into the cargo_dep_info path in a Cargo-specific format.

The pkg_root argument here is the absolute path to the directory containing Cargo.toml for this crate that was compiled. The paths listed in the rustc dep-info file may or may not be absolute but we’ll want to consider all of them relative to the root specified.

The rustc_cwd argument is the absolute path to the cwd of the compiler when it was invoked.

If the allow_package argument is true, then package-relative paths are included. If it is false, then package-relative paths are skipped and ignored (typically used for registry or git dependencies where we assume the source never changes, and we don’t want the cost of running stat on all those files). See the module-level docs for the note about -Zbinary-dep-depinfo for more details on why this is done.

The serialized Cargo format will contain a list of files, all of which are relative if they’re under root. or absolute if they’re elsewhere.