Configure tar to not set mtime

Signed-off-by: Khionu Sybiern <dev@khionu.net>
This commit is contained in:
Khionu Sybiern 2018-11-03 17:29:00 -04:00
parent 0c6bb242ba
commit 541e990681
2 changed files with 7 additions and 0 deletions

View file

@ -64,6 +64,10 @@ openssl = { version = '0.10.11', optional = true }
# for more information.
rustc-workspace-hack = "1.0.0"
# TODO: This patch will be removed before PR merge, when tar has a release containing this patch
[patch.crates-io]
tar = { git = "https://github.com/alexcrichton/tar-rs", rev = "f442964" }
[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = { version = "0.6.0", features = ["mac_os_10_7_support"] }

View file

@ -418,6 +418,9 @@ fn run_verify(ws: &Workspace, tar: &FileLock, opts: &PackageOpts) -> CargoResult
paths::remove_dir_all(&dst)?;
}
let mut archive = Archive::new(f);
// We don't need to set the Modified Time, as it's not relevant to verification
// and it errors on filesystems that don't support setting a modified timestamp
archive.set_preserve_mtime(false);
archive.unpack(dst.parent().unwrap())?;
// Manufacture an ephemeral workspace to ensure that even if the top-level