Skip to content

Commit 0c74d24

Browse files
committed
chore(deps): update tar to 0.4.42
The new version of tar enables the creation of sparse tar archives by default. The ability to read such sparse entries was added in tar 0.4.6, which has been in use starting from Cargo 0.13 and Rust 1.12. Additionally, `docker cp` doesn't support sparse tar entries in the GNU format. For compatibility with older versions of Rust and Cargo, as well as with `docker cp`, this commit disables sparse archive creation in the corresponding cases where the `tar::Builder` is used. See #14594.
1 parent fd5f1a0 commit 0c74d24

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ shell-escape = "0.1.5"
9494
similar = "2.6.0"
9595
supports-hyperlinks = "3.0.0"
9696
snapbox = { version = "0.6.17", features = ["diff", "dir", "term-svg", "regex", "json"] }
97-
tar = { version = "0.4.41", default-features = false }
97+
tar = { version = "0.4.42", default-features = false }
9898
tempfile = "3.10.1"
9999
thiserror = "1.0.63"
100100
time = { version = "0.3.36", features = ["parsing", "formatting", "serde"] }

crates/cargo-test-support/src/containers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ impl Container {
122122
return;
123123
}
124124
let mut ar = tar::Builder::new(Vec::new());
125+
ar.sparse(false);
125126
let files = std::mem::replace(&mut self.files, Vec::new());
126127
for mut file in files {
127128
ar.append_data(&mut file.header, &file.path, file.contents.as_slice())

crates/cargo-test-support/src/registry.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,7 @@ impl Package {
15131513
t!(fs::create_dir_all(dst.parent().unwrap()));
15141514
let f = t!(File::create(&dst));
15151515
let mut a = Builder::new(GzEncoder::new(f, Compression::none()));
1516+
a.sparse(false);
15161517

15171518
if !self
15181519
.files

src/cargo/ops/cargo_package.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,7 @@ fn tar(
903903

904904
// Put all package files into a compressed archive.
905905
let mut ar = Builder::new(encoder);
906+
ar.sparse(false);
906907
let gctx = ws.gctx();
907908

908909
let base_name = format!("{}-{}", pkg.name(), pkg.version());

0 commit comments

Comments
 (0)