-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Extracting tar failed due to GNU Sparse File extension not properly supported #295
Comments
Here's the reproduction. Just run |
I don't know what this is precisely but it looks like a gnu-specific extension to the |
@alexcrichton I also thought that until I saw this:
The |
@alexcrichton Pinging as this has been stale for a month. |
@alexcrichton Pinging |
I'm having the same issue when using flate2 = "1.0"
tar = "0.4.38" When I'm trying to unpack tokei-x86_64-apple-darwin.tar.gz using the following code: fn unpack_tar(tar_path: &PathBuf, tmp_dir: &Path) -> Result<(), std::io::Error> {
let tar_file = File::open(tar_path)?;
let tar_decoder = GzDecoder::new(tar_file);
let mut archive = tar::Archive::new(tar_decoder);
archive.unpack(tmp_dir)
} I see that the unpacking result produces the $ exa --tree
.
├── GNUSparseFile.0
│ └── tokei
└── tokei-x86_64-apple-darwin.tar.gz I'm not sure if the file actually valid (since I'm on Ubuntu 20.04 and the archive contents a macOS executable so I can't run it). But is this expected and can/should it be fixed? |
@chshersh #298 should fix this, but I haven't tested the solution and @alexcrichton hasn't reviewed it yet. |
Same issue when unpacking cargo-generate tar.gz using:
|
The tarball for the Darwin x86-64 release uses the GNU sparse format, which isn't supported by the tar crate (alexcrichton/tar-rs#295). Switching to the binstall-tar fork of the tar crate fixes this.
The tarball for the Darwin x86-64 release uses the GNU sparse format, which isn't supported by the tar crate (alexcrichton/tar-rs#295). Switching to the binstall-tar fork of the tar crate fixes this.
The tarball for the Darwin x86-64 release uses the GNU sparse format, which isn't supported by the tar crate (alexcrichton/tar-rs#295). Switching to the binstall-tar fork of the tar crate fixes this.
This fixes an issue with untarring tarballs that use the GNU sparse format. The tarball for the ubi Darwin x86-64 release uses the GNU sparse format, which isn't supported by the tar crate (alexcrichton/tar-rs#295). Switching to the binstall-tar fork of the tar crate fixes this.
When extracting cbindgen-0.24.3-x86_64-apple-darwin.tar.gz using the following equivalent code:
where
dat
is some readable that is pipelined from the downloading stage, I got:Using
file cbindgen
shows that it is just data, does not have executable set and cannot be executed afterchmod +x cbindgen
.While it should be:
I used
bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
and it handles it just fine.Here's the relevant part of the
Cargo.toml
:I discovered this bug in cargo-bins/cargo-binstall#174
The text was updated successfully, but these errors were encountered: