We create an artificial Git repo to apply patches.
Python build system thinks that it's building from Git and embeds a bogus
branch name into its version string:
$ python3
Python 3.9.0b5 (heads/master-dirty:24c7f56, Aug 3 2020, 00:00:00)
[GCC 10.2.1 20200804 (Red Hat 10.2.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Tell configure that Git is not installed. This reverts that part
of sys.version to "default".
Some patches are applied conditionally, so we need to use %autosetup with -N,
to prevent automatic patch application.
Later patches from 190 up are applied (with -m for minimum).
While not necessary shorter, this no longer requires adding/removing %patch XYZ
when adding/removing patches > 190.
While at it, we also use git am to apply the patches
since they are all generated from git anyway.
This makes it easier if we ever patch binary files.
This is partial backport of https://src.fedoraproject.org/rpms/python3.9/c/0a760f01ca
Remove downstream 00178-dont-duplicate-flags-in-sysconfig.patch which
introduced a bug on distutils.sysconfig.get_config_var('LIBPL').
Resolves: rhbz#1851008
The failure:
======================================================================
ERROR: test_protocol_sslv23 (test.test_ssl.ThreadedTests)
Connecting to an SSLv23 server with various client options
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/test/test_ssl.py", line 178, in f
return func(*args, **kwargs)
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/test/test_ssl.py", line 2696, in test_protocol_sslv23
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, 'TLSv1')
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/test/test_ssl.py", line 2385, in try_protocol_combo
chatty=False, connectionchatty=False)
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/test/test_ssl.py", line 2310, in server_params_test
s.connect((HOST, server.port))
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/ssl.py", line 1065, in connect
self._real_connect(addr, False)
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/ssl.py", line 1056, in _real_connect
self.do_handshake()
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/ssl.py", line 1033, in do_handshake
self._sslobj.do_handshake()
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/ssl.py", line 645, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:877)
======================================================================
ERROR: test_protocol_tlsv1_1 (test.test_ssl.ThreadedTests)
Connecting to a TLSv1.1 server with various client options.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/test/test_ssl.py", line 178, in f
return func(*args, **kwargs)
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/test/test_ssl.py", line 2771, in test_protocol_tlsv1_1
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1_1, 'TLSv1.1')
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/test/test_ssl.py", line 2385, in try_protocol_combo
chatty=False, connectionchatty=False)
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/test/test_ssl.py", line 2310, in server_params_test
s.connect((HOST, server.port))
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/ssl.py", line 1065, in connect
self._real_connect(addr, False)
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/ssl.py", line 1056, in _real_connect
self.do_handshake()
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/ssl.py", line 1033, in do_handshake
self._sslobj.do_handshake()
File "/builddir/build/BUILD/Python-3.6.11rc1/Lib/ssl.py", line 645, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:877)
----------------------------------------------------------------------
Ran 135 tests in 2.293s
FAILED (errors=2, skipped=9)
1 test failed again:
test_ssl
== Tests result: FAILURE then FAILURE ==
Started to occur after:
-crypto-policies-20200610-1.git7f9d474.fc33.noarch
+crypto-policies-20200625-1.gitb298a9e.fc33.noarch
> DEFAULT policy: Drop DH < 2048 bits, TLS 1.0, 1.1, SHA-1
Upstream fix:
- https://bugs.python.org/issue38275
- https://github.com/python/cpython/pull/16427
00205-make-libpl-respect-lib64.patch only modified LIBPL in
Makefile.pre.in which leads to an inconsistency in
python3-config --configdir which uses the unmodified LIBPL (use
/usr/lib instead of /usr/lib64).
00102-lib64.patch now updates LIBPL in configure.ac instead, as it is
done in Python 3.8 patch. Remove
00205-make-libpl-respect-lib64.patch.
Resolves: rhbz#1772988