From bae5e50a532f38951386be12569aa04929ac1b1e Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Jul 28 2020 17:07:26 +0000 Subject: Convert patches to use github.com/fedora-python/importpatches --- diff --git a/00001-rpath.patch b/00001-rpath.patch index 3394544..aad3612 100644 --- a/00001-rpath.patch +++ b/00001-rpath.patch @@ -1,4 +1,4 @@ -From 9911113c75b8a446b11009362205b40f011a4700 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 13 Jan 2010 21:25:18 +0000 Subject: [PATCH] 00001: Fixup distutils/unixccompiler.py to remove standard @@ -28,6 +28,3 @@ index 4d7a6de740..353086a648 100644 def preprocess(self, source, output_file=None, macros=None, include_dirs=None, extra_preargs=None, extra_postargs=None): fixed_args = self._fix_compile_args(None, macros, include_dirs) --- -2.26.2 - diff --git a/00102-lib64.patch b/00102-lib64.patch index 4e6f6e2..04e7045 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -1,4 +1,4 @@ -From bf40f2be75ddde2deb9e33cc6ffe828b83cfc8d8 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Wed, 13 Jan 2010 21:25:18 +0000 Subject: [PATCH] 00102: Change the various install paths to use /usr/lib64/ @@ -239,6 +239,3 @@ index bf90600eaa..8070b86c2f 100644 extra_link_args=readline_extra_link_args, libraries=readline_libs) ) else: --- -2.26.2 - diff --git a/00111-no-static-lib.patch b/00111-no-static-lib.patch index 4f0e5fd..00c894e 100644 --- a/00111-no-static-lib.patch +++ b/00111-no-static-lib.patch @@ -1,4 +1,4 @@ -From 43f81ea5b092c46d7386866e7e1a86c548185662 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 18 Jan 2010 17:59:07 +0000 Subject: [PATCH] 00111: Don't try to build a libpythonMAJOR.MINOR.a @@ -73,6 +73,3 @@ index 78152c1e2f..648729586a 100644 $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c $(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in --- -2.26.2 - diff --git a/00155-avoid-ctypes-thunks.patch b/00155-avoid-ctypes-thunks.patch index d427208..d5c5bcd 100644 --- a/00155-avoid-ctypes-thunks.patch +++ b/00155-avoid-ctypes-thunks.patch @@ -1,4 +1,4 @@ -From 5d496d5bb9c8e0207e6b22f015180b252868ce03 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 19 Jun 2020 16:02:24 +0200 Subject: [PATCH] 00155: avoid allocating thunks in ctypes unless absolutely @@ -28,6 +28,3 @@ index dae408a867..f4178c0731 100644 def create_unicode_buffer(init, size=None): """create_unicode_buffer(aString) -> character array --- -2.26.2 - diff --git a/00170-gc-assertions.patch b/00170-gc-assertions.patch index a6d7a3b..12bbbc9 100644 --- a/00170-gc-assertions.patch +++ b/00170-gc-assertions.patch @@ -1,4 +1,4 @@ -From 41d74cb6f168994477400503d97257ad02976080 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Fri, 19 Jun 2020 16:05:07 +0200 Subject: [PATCH] 00170: In debug builds, try to print repr() when a C-level @@ -333,6 +333,3 @@ index 21fa7b5660..71c960ecf1 100644 #ifndef Py_TRACE_REFS /* For Py_LIMITED_API, we need an out-of-line version of _Py_Dealloc. Define this here, so we can undefine the macro. */ --- -2.26.2 - diff --git a/00189-use-rpm-wheels.patch b/00189-use-rpm-wheels.patch index f6a4aaa..68ff390 100644 --- a/00189-use-rpm-wheels.patch +++ b/00189-use-rpm-wheels.patch @@ -1,4 +1,4 @@ -From 82210eabe82e891337e9a71a46212c9c1e844d20 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 15 Aug 2018 15:36:29 +0200 Subject: [PATCH] 00189: Instead of bundled wheels, use our RPM packaged wheels @@ -63,6 +63,3 @@ index 94d40b0c8d..87d262814e 100644 additional_paths.append(os.path.join(tmpdir, wheel_name)) --- -2.26.2 - diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 5b66d63..8c09c7c 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -1,4 +1,4 @@ -From 77c0df3cf9975a9b4214d091cb36fbf775d42403 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Michal Cyprian Date: Mon, 26 Jun 2017 16:32:56 +0200 Subject: [PATCH] 00251: Change user install location @@ -59,6 +59,3 @@ index 78bb7905f2..5665689eb9 100644 for sitedir in getsitepackages(prefixes): if os.path.isdir(sitedir): addsitedir(sitedir, known_paths) --- -2.26.2 - diff --git a/00274-fix-arch-names.patch b/00274-fix-arch-names.patch index cdf01aa..10053f5 100644 --- a/00274-fix-arch-names.patch +++ b/00274-fix-arch-names.patch @@ -1,4 +1,4 @@ -From 3816c7f58e0f30209519636b1fd1d9d41ec7e4f6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Mon, 28 Aug 2017 17:16:46 +0200 Subject: [PATCH] 00274: Upstream uses Debian-style architecture naming, change @@ -81,6 +81,3 @@ index 6f11a6df5b..13340da7c8 100644 # elif defined(__s390x__) s390x-linux-gnu # elif defined(__s390__) --- -2.26.2 - diff --git a/00316-mark-bdist_wininst-unsupported.patch b/00316-mark-bdist_wininst-unsupported.patch index 6fd30a4..e80e34f 100644 --- a/00316-mark-bdist_wininst-unsupported.patch +++ b/00316-mark-bdist_wininst-unsupported.patch @@ -1,4 +1,4 @@ -From 6fd4bb3692a6af61dab5558218dc32119e1b03da Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 19 Jun 2020 16:16:41 +0200 Subject: [PATCH] 00316: Mark bdist_wininst unsupported @@ -22,6 +22,3 @@ index 15434c3a98..829c1c6803 100644 description = "create an executable installer for MS Windows" --- -2.26.2 - diff --git a/00328-pyc-timestamp-invalidation-mode.patch b/00328-pyc-timestamp-invalidation-mode.patch index 71752f3..25e67da 100644 --- a/00328-pyc-timestamp-invalidation-mode.patch +++ b/00328-pyc-timestamp-invalidation-mode.patch @@ -1,4 +1,4 @@ -From 8efb4775f9be49024b428d779dea2ad2966a58db Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 19 Jun 2020 16:18:39 +0200 Subject: [PATCH] 00328: Restore pyc to TIMESTAMP invalidation mode as default @@ -48,6 +48,3 @@ index df45764f04..a0afd878d8 100644 return fxn(*args, **kwargs) return wrapper --- -2.26.2 - diff --git a/00335-backport-pathfix-change.patch b/00335-backport-pathfix-change.patch index 92faf6e..c5ed498 100644 --- a/00335-backport-pathfix-change.patch +++ b/00335-backport-pathfix-change.patch @@ -1,35 +1,26 @@ -commit b8f85fc797aeee09a50718f402e0c95e68467d50 -Author: Patrik Kopkan -Date: Mon Nov 4 10:45:49 2019 +0100 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Patrik Kopkan +Date: Tue, 28 Jul 2020 18:38:07 +0200 +Subject: [PATCH] 00335: Backport pathfix change - commit 211987de0de73e2747e14fcfa217b20c1ec7d817 - Author: Patrik Kopkan - Date: Fri Sep 6 15:09:43 2019 +0200 - - bpo-37064: add -a to Tools/Scripts/pathfix.py - - this option enables to add single literal - flag to kept flags - - commit 3f43ceff186da09978d0aff257bb18b8ac7611f7 - Author: Victor Stinner - Date: Thu Sep 5 18:09:46 2019 +0200 - - bpo-37064: Skip test_tools.test_pathfix if installed (GH-15705) - - If Python is installed, skip test_tools.test_pathfix test because - Tools/scripts/pathfix.py script is not installed. - - commit 50254ac4c179cb412e90682098c97db786143929 - Author: PatrikKopkan - Date: Thu Sep 5 16:54:54 2019 +0200 - - bpo-37064: Add option -k to Tools/scripts/pathfix.py (GH-15548) - - Add flag -k to pathscript.py script: preserve shebang flags +Tools/scripts/pathfix.py backports +Add -k and -a command line options to preserve and add shebang flags +In upstream since 3.8: https://bugs.python.org/issue37064 +Assume all .py files are Python scripts when working recursively: +In upstream since 3.8: https://bugs.python.org/issue38347 + +Co-authored-by: Victor Stinner +--- + Lib/test/test_tools/test_pathfix.py | 129 ++++++++++++++++++ + .../2019-05-27-15-26-12.bpo-37064.k_SPW2.rst | 2 + + Tools/scripts/pathfix.py | 60 +++++++- + 3 files changed, 186 insertions(+), 5 deletions(-) + create mode 100644 Lib/test/test_tools/test_pathfix.py + create mode 100644 Misc/NEWS.d/next/Tools-Demos/2019-05-27-15-26-12.bpo-37064.k_SPW2.rst diff --git a/Lib/test/test_tools/test_pathfix.py b/Lib/test/test_tools/test_pathfix.py new file mode 100644 -index 0000000..ec36117 +index 0000000000..ec361178e6 --- /dev/null +++ b/Lib/test/test_tools/test_pathfix.py @@ -0,0 +1,129 @@ @@ -164,14 +155,14 @@ index 0000000..ec36117 + unittest.main() diff --git a/Misc/NEWS.d/next/Tools-Demos/2019-05-27-15-26-12.bpo-37064.k_SPW2.rst b/Misc/NEWS.d/next/Tools-Demos/2019-05-27-15-26-12.bpo-37064.k_SPW2.rst new file mode 100644 -index 0000000..d1210e2 +index 0000000000..d1210e2953 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2019-05-27-15-26-12.bpo-37064.k_SPW2.rst @@ -0,0 +1,2 @@ +Add option -k to pathscript.py script: preserve shebang flags. +Add option -a to pathscript.py script: add flags. diff --git a/Tools/scripts/pathfix.py b/Tools/scripts/pathfix.py -index 28ee428..127c2fe 100755 +index 28ee428a3a..127c2fe41e 100755 --- a/Tools/scripts/pathfix.py +++ b/Tools/scripts/pathfix.py @@ -1,6 +1,6 @@ diff --git a/python3.spec b/python3.spec index ce12ff7..e5351a3 100644 --- a/python3.spec +++ b/python3.spec @@ -217,33 +217,39 @@ Source10: idle3.desktop # AppData file for idle3 Source11: idle3.appdata.xml -# 00001 # -# Fixup distutils/unixccompiler.py to remove standard library path from rpath: -# Was Patch0 in ivazquez' python3000 specfile: -Patch1: 00001-rpath.patch - -# 00102 # -# Change the various install paths to use /usr/lib64/ instead or /usr/lib -# Only used when "%%{_lib}" == "lib64" -# Not yet sent upstream. +# (Patches taken from github.com/fedora-python/cpython) + +# 00001 # d06a8853cf4bae9e115f45e1d531d2dc152c5cc8 +# Fixup distutils/unixccompiler.py to remove standard library path from rpath +# Was Patch0 in ivazquez' python3000 specfile +Patch1: 00001-rpath.patch + +# 00102 # f6d9f3a37ec3401472cb317d1e6cf3433c6016e2 +# Change the various install paths to use /usr/lib64/ instead or /usr/lib/ +# +# Only used when "%%{_lib}" == "lib64". Patch102: 00102-lib64.patch -# 00111 # -# Patch the Makefile.pre.in so that the generated Makefile doesn't try to build -# a libpythonMAJOR.MINOR.a +# 00111 # 8a4a8dc638552be9ef2732dbc08b59b19c72ce05 +# Don't try to build a libpythonMAJOR.MINOR.a +# +# Downstream only: not appropriate for upstream. +# # See https://bugzilla.redhat.com/show_bug.cgi?id=556092 -# Downstream only: not appropriate for upstream Patch111: 00111-no-static-lib.patch -# 00155 # +# 00155 # 0ef7ae83073c1bbe610d4678ed56ae775fd6e174 +# avoid allocating thunks in ctypes unless absolutely necessary +# # Avoid allocating thunks in ctypes unless absolutely necessary, to avoid # generating SELinux denials on "import ctypes" and "import uuid" when # embedding Python within httpd # See https://bugzilla.redhat.com/show_bug.cgi?id=814391 Patch155: 00155-avoid-ctypes-thunks.patch - -# 00170 # +# 00170 # f9c8195c1902ea9a05a40bbdc64dd307fb2dc893 +# In debug builds, try to print repr() when a C-level assert fails +# # In debug builds, try to print repr() when a C-level assert fails in the # garbage collector (typically indicating a reference-counting error # somewhere else e.g in an extension module) @@ -253,9 +259,10 @@ Patch155: 00155-avoid-ctypes-thunks.patch # See https://bugzilla.redhat.com/show_bug.cgi?id=614680 Patch170: 00170-gc-assertions.patch -# 00189 # -# Instead of bundled wheels, use our RPM packaged wheels from -# /usr/share/python-wheels +# 00189 # 61e5557061c11cbae30cbd9114bd551a339f7a43 +# Instead of bundled wheels, use our RPM packaged wheels +# +# We keep them in /usr/share/python-wheels Patch189: 00189-use-rpm-wheels.patch # The following versions of setuptools/pip are bundled when this patch is not applied. # The versions are written in Lib/ensurepip/__init__.py, this patch removes them. @@ -264,28 +271,40 @@ Patch189: 00189-use-rpm-wheels.patch %global pip_version 20.1.1 %global setuptools_version 47.1.0 -# 00251 +# 00251 # 2eabd04356402d488060bc8fe316ad13fc8a3356 +# Change user install location +# # Set values of prefix and exec_prefix in distutils install command # to /usr/local if executable is /usr/bin/python* and RPM build -# is not detected to make pip and distutils install into separate location +# is not detected to make pip and distutils install into separate location. +# # Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe Patch251: 00251-change-user-install-location.patch -# 00274 # -# Upstream uses Debian-style architecture naming. Change to match Fedora. +# 00274 # 1e9258f6e8f70e86d5130113d3eed22993cf3da9 +# Upstream uses Debian-style architecture naming, change to match Fedora Patch274: 00274-fix-arch-names.patch -# 00316 # +# 00316 # 4fd732b55b7d8a38c25aef566884665ce925eacb +# Mark bdist_wininst unsupported +# # We remove the exe files from distutil's bdist_wininst # So we mark the command as unsupported - and the tests are skipped Patch316: 00316-mark-bdist_wininst-unsupported.patch -# 00328 # -# Restore pyc to TIMESTAMP invalidation mode as default in rpmbubild -# See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426 +# 00328 # 367fdcb5a075f083aea83ac174999272a8faf75c +# Restore pyc to TIMESTAMP invalidation mode as default in rpmbuild +# +# Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest +# %%changelog date. This makes Python default to the CHECKED_HASH pyc +# invalidation mode, bringing more reproducible builds traded for an import +# performance decrease. To avoid that, we don't default to CHECKED_HASH +# when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages). Patch328: 00328-pyc-timestamp-invalidation-mode.patch -# 00335 # +# 00335 # 781e29b0cd6f3527afe7c6aee19672f1f1292121 +# Backport pathfix change +# # Tools/scripts/pathfix.py backports # Add -k and -a command line options to preserve and add shebang flags # In upstream since 3.8: https://bugs.python.org/issue37064 @@ -293,7 +312,6 @@ Patch328: 00328-pyc-timestamp-invalidation-mode.patch # In upstream since 3.8: https://bugs.python.org/issue38347 Patch335: 00335-backport-pathfix-change.patch - # (New patches go here ^^^) # # When adding new patches to "python" and "python3" in Fedora, EL, etc.,