Don't rebuild dependencies if they haven't changed
authorAlex Crichton <alex@alexcrichton.com>
Fri, 20 Jun 2014 01:53:18 +0000 (18:53 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 20 Jun 2014 04:55:37 +0000 (21:55 -0700)
commite05b4dc838a7d01374cf9921fe109bec79e3c6a7
treecb1e4740bccf975fc8af08216b380c2edf520302
parent2af55011b537fcccabcc20f0022b0522668c6e33
Don't rebuild dependencies if they haven't changed

This commit adds support for recognizing "fingerprints" of upstream
dependencies. When a dependency's fingerprint change, it must be rebuilt.
Currently the fingerprint unconditionally includes the version of the compiler
you're using as well as a specialized version depending on the type of source
you're compiling from:

  - git sources return their fingerprint as the current SHA. This will
    disregard any local changes.
  - path sources return their fingerprint as the maximum mtime of any file found
    at the location. This is a little too coarse and may rebuild packages too
    often (due to sub-packages), but this should get the job done for now.

When executing `cargo compile`, dependencies are not rebuilt if their
fingerprint remained constant.
src/cargo/core/package.rs
src/cargo/core/source.rs
src/cargo/ops/cargo_read_manifest.rs
src/cargo/ops/cargo_rustc.rs
src/cargo/sources/git/source.rs
src/cargo/sources/git/utils.rs
src/cargo/sources/path.rs
tests/support/mod.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_git_deps.rs
tests/test_cargo_compile_path_deps.rs