From 7180f8e3c32de5f91fba04d79a87addbba1f6007 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Oct 16 2019 05:48:19 +0000 Subject: [PATCH 1/6] 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/python37.spec b/python37.spec index ad71fdb..52defb2 100644 --- a/python37.spec +++ b/python37.spec @@ -55,7 +55,7 @@ License: Python # Extra build for debugging the interpreter or C-API extensions # (the -debug subpackages) %if %{with flatpackage} -%bcond_with debug_build +%bcond_without debug_build %else %bcond_without debug_build %endif @@ -767,7 +767,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 2e4dc60df3f67b5e149228619ee37b898a44d604 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 05:48:19 +0000 Subject: [PATCH 2/6] 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/python37.rpmlintrc b/python37.rpmlintrc index e1e2cbe..520a12d 100644 --- a/python37.rpmlintrc +++ b/python37.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 3dcd46f5ea5f5053cb1e5f53f26edbaa6c87d366 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 05:48:19 +0000 Subject: [PATCH 3/6] Update rpmlintrc to accept Python >= 3.10 --- diff --git a/python37.rpmlintrc b/python37.rpmlintrc index 520a12d..aae9e54 100644 --- a/python37.rpmlintrc +++ b/python37.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 f3f170aba9783ad7390cb908855030409d49bbea Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Oct 16 2019 05:48:19 +0000 Subject: [PATCH 4/6] 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/python37.spec b/python37.spec index 52defb2..6d718d5 100644 --- a/python37.spec +++ b/python37.spec @@ -720,7 +720,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 fc5de2f2bfb7982dcd8000c54fc98c54fb8ce3fa Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 05:48:19 +0000 Subject: [PATCH 5/6] 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/python37.spec b/python37.spec index 6d718d5..709f496 100644 --- a/python37.spec +++ b/python37.spec @@ -719,8 +719,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 e77dda16a6d20f310cf928ce2a588b861a684c72 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Oct 16 2019 05:48:19 +0000 Subject: [PATCH 6/6] Update to 3.7.5 --- diff --git a/python37.spec b/python37.spec index 709f496..0a50e7e 100644 --- a/python37.spec +++ b/python37.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} @@ -1541,6 +1541,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