Skip to content

Commit 6411d39

Browse files
committed
Auto merge of #6257 - khionu:master, r=alexcrichton
Configure tar to not set mtime This PR is fixes #6238. Currently uses a `patch` on `tar`, and should not be merged until `tar` makes a release containing the function `set_preserve_mtime`.
2 parents d278915 + 5a59494 commit 6411d39

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ serde_derive = "1.0"
5050
serde_ignored = "0.0.4"
5151
serde_json = { version = "1.0.30", features = ["raw_value"] }
5252
shell-escape = "0.1.4"
53-
tar = { version = "0.4.15", default-features = false }
53+
tar = { version = "0.4.18", default-features = false }
5454
tempfile = "3.0"
5555
termcolor = "1.0"
5656
toml = "0.4.2"

src/cargo/ops/cargo_package.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,9 @@ fn run_verify(ws: &Workspace, tar: &FileLock, opts: &PackageOpts) -> CargoResult
418418
paths::remove_dir_all(&dst)?;
419419
}
420420
let mut archive = Archive::new(f);
421+
// We don't need to set the Modified Time, as it's not relevant to verification
422+
// and it errors on filesystems that don't support setting a modified timestamp
423+
archive.set_preserve_mtime(false);
421424
archive.unpack(dst.parent().unwrap())?;
422425

423426
// Manufacture an ephemeral workspace to ensure that even if the top-level

0 commit comments

Comments
 (0)