Skip to content

Commit

Permalink
Utilize dep-info for all dependencies
Browse files Browse the repository at this point in the history
Now that sysroot dependencies are encoded, we want to know about them
regardless of whether the crate itself is unlikely to change contents.
  • Loading branch information
Mark-Simulacrum committed Jun 14, 2019
1 parent 807429e commit 3edef32
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/cargo/core/compiler/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,10 @@
//!
//! ## Special considerations
//!
//! Registry dependencies do not track the mtime of files. This is because
//! registry dependencies are not expected to change (if a new version is
//! used, the Package ID will change, causing a rebuild). Cargo currently
//! partially works with Docker caching. When a Docker image is built, it has
//! normal mtime information. However, when a step is cached, the nanosecond
//! portions of all files is zeroed out. Currently this works, but care must
//! be taken for situations like these.
//! Cargo currently partially works with Docker caching. When a Docker image is
//! built, it has normal mtime information. However, when a step is cached, the
//! nanosecond portions of all files is zeroed out. Currently this works, but
//! care must be taken for situations like these.
//!
//! HFS on macOS only supports 1 second timestamps. This causes a significant
//! number of problems, particularly with Cargo's testsuite which does rapid
Expand Down Expand Up @@ -1108,13 +1105,8 @@ fn calculate_normal<'a, 'cfg>(
})
}

// We want to use the mtime for files if we're a path source, but if we're a
// git/registry source, then the mtime of files may fluctuate, but they won't
// change so long as the source itself remains constant (which is the
// responsibility of the source)
fn use_dep_info(unit: &Unit<'_>) -> bool {
let path = unit.pkg.summary().source_id().is_path();
!unit.mode.is_doc() && path
!unit.mode.is_doc()
}

/// Calculate a fingerprint for an "execute a build script" unit. This is an
Expand Down

0 comments on commit 3edef32

Please sign in to comment.