Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a02b6e5

Browse files
committedMay 27, 2021
Update tar dependency to 0.4.34
Pulls in a fix which should avoid 0 mtime files from showing up. Closes #9512
1 parent f0b39fc commit a02b6e5

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed
 

‎Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ serde_ignored = "0.1.0"
5656
serde_json = { version = "1.0.30", features = ["raw_value"] }
5757
shell-escape = "0.1.4"
5858
strip-ansi-escapes = "0.1.0"
59-
tar = { version = "0.4.26", default-features = false }
59+
tar = { version = "0.4.35", default-features = false }
6060
tempfile = "3.0"
6161
termcolor = "1.1"
6262
toml = "0.5.7"

‎src/cargo/ops/cargo_package.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ fn tar(
537537
header.set_entry_type(EntryType::file());
538538
header.set_mode(0o644);
539539
header.set_size(contents.len() as u64);
540+
// use something nonzero to avoid rust-lang/cargo#9512
541+
header.set_mtime(1);
540542
header.set_cksum();
541543
ar.append_data(&mut header, &ar_path, contents.as_bytes())
542544
.with_context(|| format!("could not archive source file `{}`", rel_str))?;

‎tests/testsuite/package.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,9 +2000,10 @@ fn reproducible_output() {
20002000
let mut archive = Archive::new(decoder);
20012001
for ent in archive.entries().unwrap() {
20022002
let ent = ent.unwrap();
2003+
println!("checking {:?}", ent.path());
20032004
let header = ent.header();
20042005
assert_eq!(header.mode().unwrap(), 0o644);
2005-
assert_eq!(header.mtime().unwrap(), 0);
2006+
assert!(header.mtime().unwrap() != 0);
20062007
assert_eq!(header.username().unwrap().unwrap(), "");
20072008
assert_eq!(header.groupname().unwrap().unwrap(), "");
20082009
}

0 commit comments

Comments
 (0)
Please sign in to comment.