During the coordinated Rawhide libffi rebuild, I've noticed python3.7 fails to build on s390x: ====================================================================== FAIL: test_pair (test.test_zlib.CompressObjectTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.7.12/Lib/test/test_zlib.py", line 238, in test_pair self.assertEqual(x1 + x2, datazip) AssertionError: b'x\x9c\xe2\xf2qt\r\nq\r\xe6\xe2R\x80\x00\x7f\x1d\x[98329 chars]\x95' != b'x\x9c\xe3\xf2qt\r\nq\r\xe6\xe2R\x80\x00\x7f\x1d\x[115073 chars]\x95' ====================================================================== FAIL: test_speech128 (test.test_zlib.CompressTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/builddir/build/BUILD/Python-3.7.12/Lib/test/test_zlib.py", line 181, in test_speech128 self.assertEqual(zlib.compress(bytearray(data)), x) AssertionError: b'x\x[4440 chars]c\x02\xa6\xb4\x02.\xc6Q\x01\xa3V\'\xbe\xf9\xb8[109483 chars]\x95' != b'x\x[4440 chars]c\x02&\xb7\x02\xce!P\x01\xa3V\'\xbe\xf9\xb8*\x[110633 chars]\x95' ---------------------------------------------------------------------- s390x is likely the only affected architecture. Original Koji builds: https://koji.fedoraproject.org/koji/taskinfo?taskID=80984971 and https://koji.fedoraproject.org/koji/taskinfo?taskID=80997410 Full arch scratch build with libffi 3.4: https://koji.fedoraproject.org/koji/taskinfo?taskID=81054710
The same test failures have been reported on RHEL8 and the issue was closed as "NOT A BUG". See the issues for details: https://bugzilla.redhat.com/show_bug.cgi?id=1974658
> python3.7 fails to build on s390x: test_pair and test_speech128 (test.test_zlib.CompressTestCase) fail The s390x has a hardware accelerator for gzip. Depending if the hardware accelerator is used or not, the output is different. Also, test_zlib compress data in two different ways and then expect the same output. It works with the sofware implementation which creates a single block. It doesn't work with the hardware implementation which creates multiple blocks. Maybe the hardware implementation has a shorter buffer or doesn't implement the optimization avoiding the creation of multiple blocks.
Full arch scratch build with libffi 3.1: https://koji.fedoraproject.org/koji/taskinfo?taskID=81058354 It shows the same error, so this is not libffi related. The previous scratch build with libffi 3.4 has finished, it shows that this is s390x specific.
The related RHEL 8 bugzilla bz1974658 is now public.
Let's solve this by skipping these two tests on s390x.
https://src.fedoraproject.org/rpms/python3.7/pull-request/38
I proposed a PR upstream to skip test_pair() and test_speech128() on s390x: * https://bugs.python.org/issue46623 * https://github.com/python/cpython/pull/31096
FEDORA-2022-f550633b7d has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-f550633b7d
FEDORA-2022-f550633b7d has been pushed to the Fedora 36 stable repository. If problem still persists, please make note of it in this bug report.
FYI I made a similar change in Python 3.11 upstream: * https://github.com/python/cpython/commit/9475dc0b8d2a0db40278bbcb88a89b1265a77ec9 * https://bugs.python.org/issue46623#msg413939