Bug 413086 - Can't create .tar.lz4 nor .tar.zst files.
Summary: Can't create .tar.lz4 nor .tar.zst files.
Status: RESOLVED WORKSFORME
Alias: None
Product: ark
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Elvis Angelaccio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-17 12:58 UTC by Tony
Modified: 2020-01-03 05:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony 2019-10-17 12:58:17 UTC
SUMMARY
Trying to compress any file into either .tar.lz4 or .tar.zst will silently fail.

Checking the journal or by Running ark from a terminal and trying to do the same i get:

ark.libarchive: Failed to set compression method: Using external zstd program
ark.libarchive: Failed to set compression method: Using external lz4 program

Unticking "Automatically add extension" will create a package BUT a gzip one. (This i believe is another bug)

STEPS TO REPRODUCE
1. In Dolphin select a file > Actions > compress to
2. For "Type" select either Tar lz4 or Tar zstd
3. Hit Ok.

OBSERVED RESULT
Ark fails silently.

EXPECTED RESULT
A proper tar file created.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: opensuse tumbleweed
KDE Plasma Version: 5.17.80
KDE Frameworks Version: 5.64.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION

Information for package shared-mime-info:
-----------------------------------------
Repository     : openSUSE-Tumbleweed-Oss      
Name           : shared-mime-info             
Version        : 1.12-3.4                     
Arch           : x86_64                       
Vendor         : openSUSE                     
Installed Size : 4.8 MiB                      
Installed      : Yes                          
Status         : up-to-date                   
Source package : shared-mime-info-1.12-3.4.src
Summary        : Shared MIME Database         
Description    :                              
    This package contains:

    - The freedesktop.org shared MIME database spec.

    - The merged GNOME and KDE databases, in the new format.

    - The update-mime-database command, used to install new MIME data.

Loading repository data...
Reading installed packages...


package 'libarchive' not found.

Information for srcpackage libarchive:
--------------------------------------
Repository            : openSUSE-Tumbleweed-Source                                                          
Name                  : libarchive                                                                          
Version               : 3.4.0-1.3                                                                           
Arch                  : noarch                                                                              
Vendor                : openSUSE                                                                            
Summary               : Utility and C library to create and read several different streaming archive formats
Description           :                                                                                     
    Libarchive is a programming library that can create and read several
    different streaming archive formats, including most popular tar
    variants and several cpio formats. It can also write shar archives and
    read ISO-9660 CDROM images. The bsdtar program is an implementation of
    tar(1) that is built on top of libarchive. It started as a test
    harness, but has grown and is now the standard system tar for FreeBSD 5
    and 6.

    This package contains the bsdtar cmdline utility.
Builds binary package :                                                                                     
    S | Name                         | Version
    --+------------------------------+----------
      | bsdtar                       | 3.4.0-1.3
      | bsdtar-debuginfo             | 3.4.0-1.3
      | libarchive-debugsource       | 3.4.0-1.3
    i | libarchive-devel             | 3.4.0-1.3
    i | libarchive13                 | 3.4.0-1.3
      | libarchive13-32bit           | 3.4.0-1.3
      | libarchive13-32bit-debuginfo | 3.4.0-1.3
      | libarchive13-debuginfo       | 3.4.0-1.3
Comment 1 Méven Car 2019-10-24 10:31:49 UTC
libarchive uses zstd and lz4 commands when not linked with those libraries (as it seems to be the case in arch), installing them will probably fix this issue.

In the meantime, ark should prevent to select the option in such case.

For reference code in libarchive :
https://github.com/libarchive/libarchive/blob/3649ed23c6b4392d692580c03b10a611e3eaaa32/libarchive/archive_write_add_filter_zstd.c
https://github.com/libarchive/libarchive/blob/3649ed23c6b4392d692580c03b10a611e3eaaa32/libarchive/archive_write_add_filter_lz4.c
https://github.com/libarchive/libarchive/blob/master/CMakeLists.txt#L202
Comment 2 Méven Car 2019-10-24 10:37:48 UTC
Btw what ark -m outputs on your system ?
Comment 3 Tony 2019-10-24 11:33:21 UTC
I already have both lz4 and zstd plus liblz4-1 and libzstd1.

(In reply to Méven Car from comment #2)
> Btw what ark -m outputs on your system ?

Icon theme "gnome" not found.
application/x-bzip-compressed-tar
application/x-lzma-compressed-tar
application/x-compressed-tar
application/x-cd-image
application/x-lz4-compressed-tar
application/x-archive
application/x-xz-compressed-tar
application/x-7z-compressed
application/vnd.rar
application/x-xar
application/x-lzma
application/zip
application/x-rpm
application/x-tar
application/x-source-rpm
application/vnd.debian.binary-package
application/x-lzip-compressed-tar
application/x-deb
application/x-iso9660-appimage
application/x-cpio-compressed
application/x-rar
application/x-xz
application/x-cpio
application/x-bzip
application/x-sv4crc
application/vnd.ms-cab-compressed
application/gzip
application/x-tarz
application/x-bcpio
application/x-sv4cpio
application/x-zstd-compressed-tar
application/x-java-archive
Comment 4 Méven Car 2019-10-24 11:43:27 UTC
How about `/usr/lib/x86_64-linux-gnu/libarchive.so.13` or wherever libarchive.so is on your system ?
Comment 5 Tony 2019-10-24 19:18:19 UTC
(In reply to Méven Car from comment #4)
> How about `/usr/lib/x86_64-linux-gnu/libarchive.so.13` or wherever
> libarchive.so is on your system ?

Tumbleweed:~> ls -l /usr/lib64/ | grep libarchive
lrwxrwxrwx   1 root root        20 Oct  8 15:11 libarchive.so -> libarchive.so.13.4.0
lrwxrwxrwx   1 root root        20 Oct  8 15:11 libarchive.so.13 -> libarchive.so.13.4.0
-rwxr-xr-x   1 root root    797464 Oct  8 15:11 libarchive.so.13.4.0
Comment 6 Méven Car 2019-11-09 14:22:21 UTC
Could you run `ldd /usr/lib/x86_64-linux-gnu/libarchive.so.13` and paste the result here ?
Comment 7 Tony 2019-11-10 01:15:23 UTC
(In reply to Méven Car from comment #6)
> Could you run `ldd /usr/lib/x86_64-linux-gnu/libarchive.so.13` and paste the
> result here ?

sh-5.0$ ldd /usr/lib64/libarchive.so.13.4.0 
        linux-vdso.so.1 (0x00007ffde5bc3000)
        libcrypto.so.1.1 => /usr/lib64/libcrypto.so.1.1 (0x00007fecff6b8000)
        libacl.so.1 => /usr/lib64/libacl.so.1 (0x00007fecff6a8000)
        liblzma.so.5 => /usr/lib64/liblzma.so.5 (0x00007fecff668000)
        libbz2.so.1 => /usr/lib64/libbz2.so.1 (0x00007fecff648000)
        libz.so.1 => /lib64/libz.so.1 (0x00007fecff628000)
        libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007fecff4b8000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fecff2f0000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fecff2e8000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fecff2c0000)
        libm.so.6 => /lib64/libm.so.6 (0x00007fecff178000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fecffa78000)
Comment 8 Méven Car 2019-11-10 11:26:06 UTC
Thanks Tony.

The output of your last command confirmed my diagnosis.

To fix this locally install zstd and/or lz4 binaries on your system.

In ark the unavailable compressions will simply not be offered anymore as of https://phabricator.kde.org/D24911 providing better hitting that something is amiss when looking for zstandard, lzma or lz4 compression codecs.
Comment 9 Méven Car 2019-11-10 12:04:13 UTC
> I already have both lz4 and zstd plus

If that is the case and compressing still does not work, it might be a bug in libarchive or a missing feature.
Unfortunately their documentation is lacking for zstandard and lz4 in https://github.com/libarchive/libarchive/wiki/LibarchiveFormats and looking at their code, it seems like it was intended to work.
Comment 10 Tony 2019-11-10 21:26:08 UTC
(In reply to Méven Car from comment #9)
> > I already have both lz4 and zstd plus
> 
> If that is the case and compressing still does not work, it might be a bug
> in libarchive or a missing feature.
> Unfortunately their documentation is lacking for zstandard and lz4 in
> https://github.com/libarchive/libarchive/wiki/LibarchiveFormats and looking
> at their code, it seems like it was intended to work.

That maybe the case. I did manage to compile libarchive from source and ran its different tests, and the ones related to zstd/lz4 all Pass. Yet i have the same issue after installing it even though i can use tar to package zstd/lz4 file OK.
Comment 11 Tony 2020-01-03 05:23:07 UTC
Welp new year, new snapshot (20200101) for Tumbleweed and with this one the issue seems fixed, all working OK now.