From c102603c5725e5d668f2b1c976325f57220b5b24 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Oct 16 2019 05:57:52 +0000 Subject: [PATCH 1/8] Avoid using _prefix macro for /usr/lib/debug dir In case of flatpak module builds, _prefix is redefined as /app. rpm-build however hardcodes /usr/lib/debug without using the _prefix macro, so do the same here to match this. This fixes building Python as a flatpak module. https://bugzilla.redhat.com/show_bug.cgi?id=1737933#c14 --- diff --git a/python3.spec b/python3.spec index ce60a78..3c35276 100644 --- a/python3.spec +++ b/python3.spec @@ -768,7 +768,7 @@ topdir=$(pwd) # information %if %{with gdb_hooks} -DirHoldingGdbPy=%{_prefix}/lib/debug/%{_libdir} +DirHoldingGdbPy=%{_usr}/lib/debug/%{_libdir} mkdir -p %{buildroot}$DirHoldingGdbPy %endif # with gdb_hooks From 61b064250ee110b0ae9baaa7402765cfc6b9e70d Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 05:57:52 +0000 Subject: [PATCH 2/8] Rebased to 3.7.5rc1 Rebased patches: 102, 189 (versions only) --- diff --git a/00102-lib64.patch b/00102-lib64.patch index b082083..3f59886 100644 --- a/00102-lib64.patch +++ b/00102-lib64.patch @@ -20,10 +20,10 @@ index 0258d3d..4b969bf 100644 'scripts': '$base/bin', 'data' : '$base', diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index e07a6c8..554740d 100644 +index 0a034ee..3ce0dc1 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -129,8 +129,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): +@@ -147,8 +147,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): prefix = plat_specific and EXEC_PREFIX or PREFIX if os.name == "posix": @@ -53,7 +53,7 @@ index 287ab19..d4c05e0 100644 check_path(cmd.install_headers, os.path.join(destination, "include", "python", "foopkg")) diff --git a/Lib/site.py b/Lib/site.py -index 7dc1b04..85016b4 100644 +index 8786588..78bb790 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -334,11 +334,15 @@ def getsitepackages(prefixes=None): @@ -73,7 +73,7 @@ index 7dc1b04..85016b4 100644 return sitepackages diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py -index 9ee4d31..53c8606 100644 +index d15cec8..159c78b 100644 --- a/Lib/sysconfig.py +++ b/Lib/sysconfig.py @@ -20,10 +20,10 @@ __all__ = [ @@ -105,10 +105,10 @@ index 9ee4d31..53c8606 100644 'scripts': '{userbase}/bin', 'data': '{userbase}', diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py -index 266adf0..e8513b6 100644 +index 568f81d..234cff8 100644 --- a/Lib/test/test_site.py +++ b/Lib/test/test_site.py -@@ -275,8 +275,8 @@ class HelperFunctionsTests(unittest.TestCase): +@@ -269,8 +269,8 @@ class HelperFunctionsTests(unittest.TestCase): dirs = site.getsitepackages() if os.sep == '/': # OS X, Linux, FreeBSD, etc @@ -120,10 +120,10 @@ index 266adf0..e8513b6 100644 'site-packages') self.assertEqual(dirs[0], wanted) diff --git a/Makefile.pre.in b/Makefile.pre.in -index 59ba9d4..5780ed8 100644 +index beaccf5..bba49ca 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in -@@ -133,7 +133,7 @@ LIBDIR= @libdir@ +@@ -144,7 +144,7 @@ LIBDIR= @libdir@ MANDIR= @mandir@ INCLUDEDIR= @includedir@ CONFINCLUDEDIR= $(exec_prefix)/include @@ -133,10 +133,10 @@ index 59ba9d4..5780ed8 100644 # Detailed destination directories diff --git a/Modules/getpath.c b/Modules/getpath.c -index 85e737b..2a1fc79 100644 +index ba8d74b..198e8f0 100644 --- a/Modules/getpath.c +++ b/Modules/getpath.c -@@ -500,7 +500,7 @@ calculate_exec_prefix(const _PyCoreConfig *core_config, +@@ -535,7 +535,7 @@ calculate_exec_prefix(const _PyCoreConfig *core_config, "Could not find platform dependent libraries \n"); } wcsncpy(exec_prefix, calculate->exec_prefix, MAXPATHLEN); @@ -145,7 +145,7 @@ index 85e737b..2a1fc79 100644 } /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ } -@@ -742,7 +742,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix) +@@ -787,7 +787,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix) else { wcsncpy(calculate->zip_path, calculate->prefix, MAXPATHLEN); } @@ -154,8 +154,8 @@ index 85e737b..2a1fc79 100644 /* Replace "00" with version */ size_t bufsz = wcslen(calculate->zip_path); -@@ -867,7 +867,7 @@ calculate_init(PyCalculatePath *calculate, - if (!calculate->prefix) { +@@ -912,7 +912,7 @@ calculate_init(PyCalculatePath *calculate, + if (!calculate->exec_prefix) { return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); } - calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len); @@ -164,10 +164,10 @@ index 85e737b..2a1fc79 100644 return DECODE_LOCALE_ERR("EXEC_PREFIX define", len); } diff --git a/setup.py b/setup.py -index f1933f7..450cd8a 100644 +index 88cff61..ecbf798 100644 --- a/setup.py +++ b/setup.py -@@ -531,7 +531,7 @@ class PyBuildExt(build_ext): +@@ -585,7 +585,7 @@ class PyBuildExt(build_ext): # directories (i.e. '.' and 'Include') must be first. See issue # 10520. if not cross_compiling: @@ -176,7 +176,7 @@ index f1933f7..450cd8a 100644 add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') # only change this for cross builds for 3.3, issues on Mageia if cross_compiling: -@@ -830,11 +830,11 @@ class PyBuildExt(build_ext): +@@ -891,11 +891,11 @@ class PyBuildExt(build_ext): elif curses_library: readline_libs.append(curses_library) elif self.compiler.find_library_file(lib_dirs + diff --git a/00189-use-rpm-wheels.patch b/00189-use-rpm-wheels.patch index ffb80af..774b198 100644 --- a/00189-use-rpm-wheels.patch +++ b/00189-use-rpm-wheels.patch @@ -16,9 +16,9 @@ index 4748ba4..fc02255 100644 +_WHEEL_DIR = "/usr/share/python-wheels/" --_SETUPTOOLS_VERSION = "40.8.0" +-_SETUPTOOLS_VERSION = "41.2.0" --_PIP_VERSION = "19.0.3" +-_PIP_VERSION = "19.2.3" +def _get_most_recent_wheel_version(pkg): + prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg)) + suffix = "-py2.py3-none-any.whl" diff --git a/python3.spec b/python3.spec index 3c35276..538ef46 100644 --- a/python3.spec +++ b/python3.spec @@ -13,8 +13,8 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well -%global general_version %{pybasever}.4 -#global prerel ... +%global general_version %{pybasever}.5 +%global prerel rc1 %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} Release: 1%{?dist} @@ -411,8 +411,8 @@ Requires: gdbm-libs%{?_isa} >= 1:1.13 Requires: python-setuptools-wheel Requires: python-pip-wheel %else -Provides: bundled(python3-pip) = 19.0.3 -Provides: bundled(python3-setuptools) = 40.8.0 +Provides: bundled(python3-pip) = 19.2.3 +Provides: bundled(python3-setuptools) = 41.2.0 %endif # There are files in the standard library that have python shebang. @@ -589,8 +589,8 @@ Requires: redhat-rpm-config Requires: python-setuptools-wheel Requires: python-pip-wheel %else -Provides: bundled(python3-pip) = 19.0.3 -Provides: bundled(python3-setuptools) = 40.8.0 +Provides: bundled(python3-pip) = 19.2.3 +Provides: bundled(python3-setuptools) = 41.2.0 %endif # The description for the flat package @@ -1560,6 +1560,9 @@ CheckPython optimized # ====================================================== %changelog +* Wed Oct 02 2019 Miro Hrončok - 3.7.5~rc1-1 +- Update to 3.7.5rc1 + * Tue Jul 09 2019 Miro Hrončok - 3.7.4-1 - Update to 3.7.4 diff --git a/sources b/sources index dc50b76..6fdf394 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.7.4.tar.xz) = 71f64668c259f3ed07bd4aa239dbba6cc1b6b0a84d50bbff160664845d7986f757e4d65fca327e62a2d12ba593742ca83a22f7cb6093aff8715ec916c2ba9416 +SHA512 (Python-3.7.5rc1.tar.xz) = 37edfdd8d166d4e26cfd3d62ae5a52d9bb22d63e9e7e8583d0e806e04fb74ca70ee1985e72f3576176c3c601c7e4992fd93043d81e626bab02f0e437e6fe26c6 From 333f9cc23f2150286eb463b1ca1157520c0b8972 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 05:57:52 +0000 Subject: [PATCH 3/8] Update rpmlintrc to reflect 3.8 changes and python-unversioned-command - python-unversioned-command has dangling symlinks - the ABI flags no longer contain "m" - new -embed .pc files were added in 3.8 --- diff --git a/python3.rpmlintrc b/python3.rpmlintrc index d59fe13..1396877 100644 --- a/python3.rpmlintrc +++ b/python3.rpmlintrc @@ -25,15 +25,15 @@ addFilter(r'python3\d\.[^:]+: (E|W): devel-file-in-non-devel-package') addFilter(r'only-non-binary-in-usr-lib') # some devel files that are deliberately needed -addFilter(r'devel-file-in-non-devel-package /usr/include/python3\.\dm/pyconfig-(32|64)\.h') +addFilter(r'devel-file-in-non-devel-package /usr/include/python3\.\dm?/pyconfig-(32|64)\.h') addFilter(r'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d/distutils/tests/xxmodule\.c') # SORRY, NOT SORRY: # manual pages -addFilter(r'no-manual-page-for-binary (idle|pydoc|pyvenv|2to3|python3-debug|pathfix|msgfmt|pygettext)') -addFilter(r'no-manual-page-for-binary python3.*-config$') -addFilter(r'no-manual-page-for-binary python3.\dd?m$') +addFilter(r'no-manual-page-for-binary (idle|pydoc|pyvenv|2to3|python3?-debug|pathfix|msgfmt|pygettext)') +addFilter(r'no-manual-page-for-binary python3?.*-config$') +addFilter(r'no-manual-page-for-binary python3.\dd?m?$') # missing documentation from subpackages addFilter(r'^python3\d?-(debug|tkinter|test|idle)\.[^:]+: (E|W): no-documentation') @@ -62,11 +62,15 @@ addFilter(r'^python3\d?-debuginfo\.[^:]+: (E|W): useless-provides debuginfo\(bui addFilter(r'library-without-ldconfig-post') # debug package contains devel and non-devel files -addFilter(r'python3\d?-debug.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package') +addFilter(r'python3\d?-debug\.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package') # this goes to other subpackage, hence not actually dangling, the read error is bogus -addFilter(r'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\ddm\.pc python-3\.\d\.pc') -addFilter(r'read-error /usr/lib(64)?/pkgconfig/python-3\.\ddm\.pc \[Errno 2\]') +addFilter(r'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\ddm?(-embed)?\.pc python-3\.\d(-embed)?\.pc') +addFilter(r'read-error /usr/lib(64)?/pkgconfig/python-3\.\ddm?(-embed)?\.pc \[Errno 2\]') + +# the python-unversioned-command package contains dangling symlinks by design +addFilter(r'^python-unversioned-command\.[^:]+: (E|W): dangling-relative-symlink ' + r'(/usr/bin/python \./python3|/usr/share/man/man1/python\.1\S* ./python3\.1\S*)$') # we need this macro to evaluate, even if the line starts with # addFilter(r'macro-in-comment %\{_pyconfig(32|64)_h\}') From 8c9552d7c0362618702232e76696a99d7f1ed3d8 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 05:57:52 +0000 Subject: [PATCH 4/8] Update rpmlintrc to accept Python >= 3.10 --- diff --git a/python3.rpmlintrc b/python3.rpmlintrc index 1396877..ad498ee 100644 --- a/python3.rpmlintrc +++ b/python3.rpmlintrc @@ -4,7 +4,7 @@ addFilter(r'crypto-policy-non-compliance-openssl') # TESTS: -addFilter(r'(zero-length|pem-certificate|uncompressed-zip) /usr/lib(64)?/python3.\d/test') +addFilter(r'(zero-length|pem-certificate|uncompressed-zip) /usr/lib(64)?/python3\.\d+/test') # OTHER DELIBERATES: @@ -13,30 +13,30 @@ addFilter(r'missing-call-to-chdir-with-chroot') # intentionally unversioned and selfobsoleted addFilter(r'unversioned-explicit-obsoletes python') -addFilter(r'self-obsoletion python3\d obsoletes python3\d') +addFilter(r'self-obsoletion python3\d+ obsoletes python3\d+') # intentionally hardcoded addFilter(r'hardcoded-library-path in %{_prefix}/lib/(debug/%{_libdir}|python%{pybasever})') # intentional for our pythonXY package -addFilter(r'python3\d\.[^:]+: (E|W): devel-file-in-non-devel-package') +addFilter(r'python3\d+\.[^:]+: (E|W): devel-file-in-non-devel-package') # we have non binary stuff, python files addFilter(r'only-non-binary-in-usr-lib') # some devel files that are deliberately needed -addFilter(r'devel-file-in-non-devel-package /usr/include/python3\.\dm?/pyconfig-(32|64)\.h') -addFilter(r'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d/distutils/tests/xxmodule\.c') +addFilter(r'devel-file-in-non-devel-package /usr/include/python3\.\d+m?/pyconfig-(32|64)\.h') +addFilter(r'devel-file-in-non-devel-package /usr/lib(64)?/python3\.\d+/distutils/tests/xxmodule\.c') # SORRY, NOT SORRY: # manual pages addFilter(r'no-manual-page-for-binary (idle|pydoc|pyvenv|2to3|python3?-debug|pathfix|msgfmt|pygettext)') addFilter(r'no-manual-page-for-binary python3?.*-config$') -addFilter(r'no-manual-page-for-binary python3.\dd?m?$') +addFilter(r'no-manual-page-for-binary python3\.\d+d?m?$') # missing documentation from subpackages -addFilter(r'^python3\d?-(debug|tkinter|test|idle)\.[^:]+: (E|W): no-documentation') +addFilter(r'^python3\d*-(debug|tkinter|test|idle)\.[^:]+: (E|W): no-documentation') # platform python is obsoleted, but not provided addFilter(r'obsolete-not-provided platform-python') @@ -53,20 +53,20 @@ addFilter(r'python-bytecode-wrong-magic-value .* expected 33\d\d \(3\.7\), found addFilter(r'python-bytecode-inconsistent-mtime .* 1970') # debugsource -addFilter(r'^python3\d?-debugsource\.[^:]+: (E|W): no-documentation') +addFilter(r'^python3\d*-debugsource\.[^:]+: (E|W): no-documentation') # debuginfo -addFilter(r'^python3\d?-debuginfo\.[^:]+: (E|W): useless-provides debuginfo\(build-id\)') +addFilter(r'^python3\d*-debuginfo\.[^:]+: (E|W): useless-provides debuginfo\(build-id\)') # this is OK for F28+ addFilter(r'library-without-ldconfig-post') # debug package contains devel and non-devel files -addFilter(r'python3\d?-debug\.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package') +addFilter(r'python3\d*-debug\.[^:]+: (E|W): (non-)?devel-file-in-(non-)?devel-package') # this goes to other subpackage, hence not actually dangling, the read error is bogus -addFilter(r'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\ddm?(-embed)?\.pc python-3\.\d(-embed)?\.pc') -addFilter(r'read-error /usr/lib(64)?/pkgconfig/python-3\.\ddm?(-embed)?\.pc \[Errno 2\]') +addFilter(r'dangling-relative-symlink /usr/lib(64)?/pkgconfig/python-3\.\d+dm?(-embed)?\.pc python-3\.\d+(-embed)?\.pc') +addFilter(r'read-error /usr/lib(64)?/pkgconfig/python-3\.\d+dm?(-embed)?\.pc \[Errno 2\]') # the python-unversioned-command package contains dangling symlinks by design addFilter(r'^python-unversioned-command\.[^:]+: (E|W): dangling-relative-symlink ' From 964f3db58e17e1e0bd0a2cb3b10e11d082466d0a Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Oct 16 2019 05:57:52 +0000 Subject: [PATCH 5/8] Make the debug build compile with -Og Due to Python's handling of CFLAGS and the way we were passing extra compiler flags through the SPEC the -Og flag for the debug build was overridden by the -O2 flag, resulting in various side effects. See: https://bugs.python.org/issue37631 Resolves: rhbz#1678277 --- diff --git a/python3.spec b/python3.spec index 538ef46..235ce05 100644 --- a/python3.spec +++ b/python3.spec @@ -721,7 +721,7 @@ BuildPython() { %{nil} # Invoke the build - make EXTRA_CFLAGS="$CFLAGS $MoreCFlags" %{?_smp_mflags} + %make_build CFLAGS_NODIST="$CFLAGS_NODIST $MoreCFlags" popd echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfName From 1d574fe0d0a5b7eb7ffc08001f7b66e2c0b1842c Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 05:57:52 +0000 Subject: [PATCH 6/8] Pass -Og to EXTRA_CFLAGS as well as to CFLAGS_NODIST - to CFLAGS_NODIST to take precedence as CFLAGS_NODIST go after EXTRA_CFLAGS - to EXTRA_CFLAGS to "bake it in" and build extension modules with -Og - call make regen-all with the same flags, as it invokes gcc as well --- diff --git a/python3.spec b/python3.spec index 235ce05..cac05a2 100644 --- a/python3.spec +++ b/python3.spec @@ -720,8 +720,10 @@ BuildPython() { $ExtraConfigArgs \ %{nil} +%global flags_override EXTRA_CFLAGS="$MoreCFlags" CFLAGS_NODIST="$CFLAGS_NODIST $MoreCFlags" + # Invoke the build - %make_build CFLAGS_NODIST="$CFLAGS_NODIST $MoreCFlags" + %make_build %{flags_override} popd echo FINISHED: BUILD OF PYTHON FOR CONFIGURATION: $ConfName From 083861f17e6cf2364fb764ba1e3d2a9fdbf4f558 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 05:57:52 +0000 Subject: [PATCH 7/8] Update to 3.7.5 --- diff --git a/python3.spec b/python3.spec index cac05a2..70303d7 100644 --- a/python3.spec +++ b/python3.spec @@ -14,7 +14,7 @@ URL: https://www.python.org/ # WARNING When rebasing to a new Python version, # remember to update the python3-docs package as well %global general_version %{pybasever}.5 -%global prerel rc1 +#global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} Release: 1%{?dist} @@ -1562,6 +1562,9 @@ CheckPython optimized # ====================================================== %changelog +* Tue Oct 15 2019 Miro Hrončok - 3.7.5-1 +- Update to 3.7.5 + * Wed Oct 02 2019 Miro Hrončok - 3.7.5~rc1-1 - Update to 3.7.5rc1 diff --git a/sources b/sources index 6fdf394..acd5df0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (Python-3.7.5rc1.tar.xz) = 37edfdd8d166d4e26cfd3d62ae5a52d9bb22d63e9e7e8583d0e806e04fb74ca70ee1985e72f3576176c3c601c7e4992fd93043d81e626bab02f0e437e6fe26c6 +SHA512 (Python-3.7.5.tar.xz) = f4f3879881f260f58dbb041fb0f2f210d4b70b02a739e41e50e6fea67d31855a7a29ce4ebef66bfde3d0edf54b946a48f78490f986da965357b835d4dbb3f414 From 52f47288d548949391b31fa1d26a8b0592228183 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 12:31:18 +0000 Subject: [PATCH 8/8] Fedora CI: Run the smoke test on the debug build as well --- diff --git a/tests/tests.yml b/tests/tests.yml index e0d81a8..0db68e6 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -11,6 +11,9 @@ - smoke: dir: python/smoke run: VERSION=3.7 ./venv.sh + - debugsmoke: + dir: python/smoke + run: PYTHON=python3-debug TOX=false VERSION=3.7 ./venv.sh - selftest: dir: python/selftest run: VERSION=3.7 X="-x test_wsgiref" ./parallel.sh