AgentD / squashfs-tools-ng

A new set of tools and libraries for working with SquashFS images
Other
194 stars 30 forks source link

tests: test_tar_sqfs.sh failures on Fedora Rawhide (zlib -> zlib-ng transition) #125

Closed dtrudg closed 3 months ago

dtrudg commented 5 months ago

I currently package squashfs-tools-ng 1.2.0 for Fedora & EPEL: https://packages.fedoraproject.org/pkgs/squashfs-tools-ng/

In Fedora Rawhide, a mass rebuild has just occured, and the package now fails to build due to some of the test_tar_sqfs.sh tests failing:

tests/libtar/data/long-paths/gnu.sqfs: FAILED
tests/libtar/data/long-paths/pax.sqfs: FAILED
tests/libtar/data/long-paths/ustar.sqfs: FAILED
tests/libtar/data/sparse-files/gnu-small.sqfs: FAILED
tests/libtar/data/sparse-files/gnu.sqfs: OK
tests/libtar/data/sparse-files/pax-gnu0-1.sqfs: OK
tests/libtar/data/sparse-files/pax-gnu0-0.sqfs: OK
tests/libtar/data/sparse-files/pax-gnu1-0.sqfs: OK
tests/libtar/data/large-mtime/12-digit.sqfs: FAILED
tests/libtar/data/large-mtime/gnu.sqfs: FAILED
tests/libtar/data/large-mtime/pax.sqfs: FAILED
tests/libtar/data/negative-mtime/gnu.sqfs: FAILED
tests/libtar/data/negative-mtime/pax.sqfs: FAILED
tests/libtar/data/format-acceptance/gnu-g.sqfs: FAILED
tests/libtar/data/format-acceptance/gnu.sqfs: FAILED
tests/libtar/data/format-acceptance/ustar-pre-posix.sqfs: FAILED
tests/libtar/data/format-acceptance/v7.sqfs: FAILED
tests/libtar/data/format-acceptance/pax.sqfs: FAILED
tests/libtar/data/format-acceptance/ustar.sqfs: FAILED
tests/libtar/data/format-acceptance/link_filled.sqfs: OK
tests/libtar/data/user-group-largenum/gnu.sqfs: FAILED
tests/libtar/data/user-group-largenum/8-digit.sqfs: FAILED
tests/libtar/data/user-group-largenum/pax.sqfs: FAILED
tests/libtar/data/xattr/xattr-schily-binary.sqfs: FAILED
tests/libtar/data/xattr/xattr-schily.sqfs: FAILED
tests/libtar/data/xattr/xattr-libarchive.sqfs: FAILED
tests/libtar/data/xattr/acl.sqfs: FAILED
tests/tar2sqfs/root-becomes.sqfs: FAILED
sha512sum: WARNING: 23 computed checksums did NOT match
FAIL tests/tar2sqfs/test_tar_sqfs.sh (exit status: 1)

It appears that the sha512sums of the generated sqfs files are not as expected, most likely due to the switch from zlib to zlib-ng in for Fedora 40.

https://fedoraproject.org/wiki/Changes/ZlibNGTransition

🔗 Upgrade/compatibility impact

Zlib-ng has a zlib-compat mode that aims to preserve both API and ABI compatibility with the original Zlib. However certain application tests may rely on hardcoded checksums for the compressed output. These tests could fail due to various changes, even if the compressed output remains valid and decompresses correctly.

My current thinking in the short term is that in the Fedora packaging I can patch the expected shasums, having done some manual verification that the files using zlib-ng are equivalent.

I'm unclear, though, what might be an appropriate upstream PR I could attempt to work up... if one would be welcome?

Thanks again for your efforts on the tools!

AgentD commented 5 months ago

Hi @dtrudg ,

I currently package squashfs-tools-ng 1.2.0 for Fedora & EPEL: https://packages.fedoraproject.org/pkgs/squashfs-tools-ng/

In Fedora Rawhide, a mass rebuild has just occured, and the package now fails to build due to some of the test_tar_sqfs.sh tests failing:

The purpose of this test script was a crude attempt to catch regressions (and to some extend nondeterminism), i.e. if the on-disk layout of the filesystem changes between builds, releases unintentionally.

It replaces an older, much more extensive script, that tested all the supported compressors with a varying number of thread pool workers.

It appears that the sha512sums of the generated sqfs files are not as expected, most likely due to the switch from zlib to zlib-ng in for Fedora 40.

https://fedoraproject.org/wiki/Changes/ZlibNGTransition

I guess zlib-ng compresses in a different way and produces slightly different data. I ran into similar issues with the aforementioned, more extensive script. The LZ4 and Zstd compressors kept breaking practically after every update. The zlib/xz compressors looked fairly stable by comparison, so the test_tar_sqfs.sh quick test script uses that.

I'm unclear, though, what might be an appropriate upstream PR I could attempt to work up... if one would be welcome?

I guess it's probably best to remove this test altogether. It's simply not a great idea to expect a compressor to produce an exact result.

Thanks again for your efforts on the tools!

Thanks for taking the effort to package this!