Portable way for using zstd tarballs?
Hi, I see an increasing number of projects providing their sources as zstd compressed tarballs. But currently it is only possible to use them directly on Tumbleweed by adding zstd as BuildRequires. Leap is broken, as the %setup macro will not detect the zstd compression even if you add it as a build requirement. (I remember when xz works off the shelf on Factory but you had to add it as BuildRequires for the stable distribution, but for zstd %setup seems to be broken on Leap) So currently I guess you have to use something like this?
%if 0%{?suse_version} >= 1550 %setup -q %else # Leap does not support zstd as source compression %setup -cT tar -I zstd -xf %{SOURCE0} --strip-components=1 %endif
Cheers Ferdinand
On Mon, Jun 7, 2021 at 2:50 PM Ferdinand Thiessen <rpm@fthiessen.de> wrote:
Hi,
I see an increasing number of projects providing their sources as zstd compressed tarballs. But currently it is only possible to use them directly on Tumbleweed by adding zstd as BuildRequires. Leap is broken, as the %setup macro will not detect the zstd compression even if you add it as a build requirement.
(I remember when xz works off the shelf on Factory but you had to add it as BuildRequires for the stable distribution, but for zstd %setup seems to be broken on Leap)
So currently I guess you have to use something like this?
%if 0%{?suse_version} >= 1550 %setup -q %else # Leap does not support zstd as source compression %setup -cT tar -I zstd -xf %{SOURCE0} --strip-components=1 %endif
This should work with Leap 15.2 and higher, since rpm was compiled with zstd support since then. -- 真実はいつも一つ!/ Always, there's only one truth!
Am 07.06.21 um 20:52 schrieb Neal Gompa:
This should work with Leap 15.2 and higher, since rpm was compiled with zstd support since then.
No it does not work on 15.2 or 15.3, it will fail with this error:
cd /home/abuild/rpmbuild/BUILD rm -rf foobar-1.0 /usr/bin/tar -xof /home/abuild/rpmbuild/SOURCES/foobar-1.0.tar.zst /usr/bin/tar: This does not look like a tar archive /usr/bin/tar: Skipping to next header /usr/bin/tar: Exiting with failure status due to previous errors
I guess the tar version on Leap is too old, as 1.31 added zstd support (auto-detection without "-I zstd") but both use 1.30.
Oh yes, I noticed this is a bug in RPM. The magic detection for zstd was broken until 4.16.0-alpha [1], so rpm fails to detect it. On 2021-06-07, 21:14 wrote Ferdinand Thiessen:
I guess the tar version on Leap is too old, as 1.31 added zstd support (auto-detection without "-I zstd") but both use 1.30.
So this is partially true, as RPM can not detect zstd (it thinks the source is uncompressed), it invokes tar, but tar on Leap can not handle zstd without the "-I zstd" flag. [1] https://github.com/rpm-software-management/rpm/commit/c464f1ece501346da11ed7...
participants (2)
-
Ferdinand Thiessen
-
Neal Gompa