Bug 384040 - Support zstandard / zstd / .zst
Summary: Support zstandard / zstd / .zst
Status: RESOLVED FIXED
Alias: None
Product: ark
Classification: Applications
Component: plugins (show other bugs)
Version: 17.08.0
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: Ragnar Thomsen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-26 09:10 UTC by Brennan Kinney
Modified: 2018-11-06 16:26 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 18.12.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brennan Kinney 2017-08-26 09:10:17 UTC
It would be great to see support added for Facebook's zstd (aka zstandard), extension `.zst`.

Repo: https://github.com/facebook/zstd
Comment 1 Christoph Feck 2017-08-28 20:37:31 UTC
zstd is no archive format. Do you need to decompress a *.tar.zstd file?
Comment 2 Brennan Kinney 2017-08-31 01:26:50 UTC
(In reply to Christoph Feck from comment #1)
> zstd is no archive format. Do you need to decompress a *.tar.zstd file?

zstd can compress input into .zst file. To compress directories I've used it with tar to get a tar.zst file, followed with tar and zstd commands to decompress.(plus split/cat if creating multi-part files).

Any support would be good :)
Comment 3 Ragnar Thomsen 2017-08-31 17:12:34 UTC
zstd support was recently merged in the libarchive git repo. So after next libarchive release we can easily add zstd support in Ark.
Comment 4 Robert-André Mauchin 2018-10-16 04:27:19 UTC
 libarchive 3.3.3 was released in September, can this feature be pucked up?
Comment 5 Robert-André Mauchin 2018-10-16 04:33:12 UTC
I've seen that work has been done already https://phabricator.kde.org/D15369
That's great, thanks!
Comment 6 Ragnar Thomsen 2018-11-06 16:26:19 UTC
Git commit d876ba3d9ebc8f00c2b0b06c9c8bd60c824aa563 by Ragnar Thomsen.
Committed on 06/11/2018 at 16:20.
Pushed by rthomsen into branch 'master'.

Add support for Zstd-compressed Tar-archives

Libarchive 3.3.3 was released on 2018-09-04 and added support for the
Zstandard compression filter. This compression method is designed to
give similar compression ratio as gzip but with much greater
(de)compression speeds. Libarchive uses the libzstd.so library, but
seems to use the zstd binary as fallback if it wasn't built with
libzstd.

This diff enables the filter in the libarchive plugin. There is still no
mimetype in shared-mime-info, so a custom mimetype for zstd-compressed
tar archives is added. This necessitated re-adding functionality in Ark
for custom mime-types (was removed in commit
73cd5e8d2e7b347d84438b23afdc892eddb78ed2).

Support is only enabled when built with libarchive>=3.3.3.
FIXED-IN: 18.12.0
Differential Revision: D15369

M  +5    -0    CMakeLists.txt
A  +-    --    autotests/kerfuffle/data/simplearchive.tar.zst
M  +7    -0    autotests/kerfuffle/loadtest.cpp
M  +5    -0    kerfuffle/CMakeLists.txt
A  +7    -0    kerfuffle/mime/kerfuffle.xml
M  +25   -0    plugins/libarchive/CMakeLists.txt
M  +5    -0    plugins/libarchive/kerfuffle_libarchive.json.cmake
M  +2    -0    plugins/libarchive/libarchiveplugin.cpp
M  +13   -3    plugins/libarchive/readwritelibarchiveplugin.cpp

https://commits.kde.org/ark/d876ba3d9ebc8f00c2b0b06c9c8bd60c824aa563