-
-
Notifications
You must be signed in to change notification settings - Fork 392
Fails to read file from archiver.FileSystem when archive is .tar.zst #365
Comments
Thanks for the report. That's very interesting! Upon scanning the source code of |
when will it be repaired. |
@imkos Are you referring to the commented line in that code? That's probably not correct, since leaving the reader open leaks resources. |
Is there a suitable solution to this bug? |
There is, but we need to figure out how to close the compression reader beyond the scope of the |
What version of the package or command are you using?
v4.0.0-alpha.7
What are you trying to do?
Extract files from a .tar.zst (zstd) archive with the
archiver.FileSystem
feature.What steps did you take?
Minimal reproducible example:
A simple archive
test.tar.zst
with a non-emptytest
file inside it is needed, created throughWhat did you expect to happen, and what actually happened instead?
Expected successful read without error. Actually got an error from the
io.ReadAll
:This is
ErrDecoderClosed
from the zstd module. See https://pkg.go.dev/github.com/klauspost/compress/zstd.Note that if we use a .tar.gz instead there's no error. The problem is zstd-specific.
Also,
Tar.Extract()
works fine with .tar.zst, so this is specific to the FS implementation.How do you think this should be fixed?
I haven't got time to investigate yet.
Please link to any related issues, pull requests, and/or discussion
Bonus: What do you use archiver for, and do you find it useful?
I use it as a high level interface to archive/tar and compress/gzip, compress/zstd, etc. Saves a lot of boilerplate code.
The text was updated successfully, but these errors were encountered: