Be careful with zstd support in Qt 5.13
Fabian Vogt
fabian at ritter-vogt.de
Wed Jun 19 21:02:40 BST 2019
Hi,
starting with Qt 5.13, it's possible to build qtbase against libzstd, which
means rcc uses zstandard instead of zlib as compression algorithm by default.
This means that resource data can now be compressed in two different ways.
The existing QResource API only had isCompressed() though, which does not allow
to differentiate between them. A new method compressionAlgorithm() got
introduced in 5.13 to return whether zlib or zstd was used for compression,
but obviously all existing codebases do not use this, but instead assume that
qUncompress always works if the data is compressed. This assumption now fails
with 5.13 and those applications are unable to read any data.
>From a quick search on lxr.kde.org only krusader seems to rely on this, but
even the Qt SCXML module fails to build because of this API break:
https://bugreports.qt.io/browse/QTBUG-76521
In conclusion, I recommend to not enable zstd support in qtbase by default.
Not only because it breaks existing applications in non-obvious ways, but also
because the build failure of qtscxml shows that it is apparently not even
supported by Qt itself.
Cheers,
Fabian
More information about the Distributions
mailing list