#23 Sync with Python 3.7 (mostly extension flags)
Merged 5 years ago by cstratak. Opened 5 years ago by churchyard.
rpms/ churchyard/python36 37sync  into  master

file modified
+3
@@ -66,5 +66,8 @@ 

  # we need this macro to evaluate, even if the line starts with #

  addFilter(r'macro-in-comment %\{_pyconfig(32|64)_h\}')

  

+ # Python modules don't need to be linked against libc

+ addFilter(r'E: library-not-linked-against-libc /usr/lib(64)?/python3.\d/lib-dynload/')

+ 

  # SPELLING ERRORS

  addFilter(r'spelling-error .* en_US (bytecode|pyc|filename|tkinter|namespaces|pytest) ')

file modified
+23 -58
@@ -14,7 +14,7 @@ 

  #  WARNING  When rebasing to a new Python version,

  #           remember to update the python3-docs package as well

  Version: %{pybasever}.8

- Release: 5%{?dist}

+ Release: 6%{?dist}

  License: Python

  

  
@@ -181,7 +181,7 @@ 

  BuildRequires: findutils

  BuildRequires: gcc-c++

  %if %{with gdbm}

- BuildRequires: gdbm-devel >= 1:1.13

+ BuildRequires: gdbm-devel

  %endif

  BuildRequires: glibc-all-langpacks

  BuildRequires: glibc-devel
@@ -196,6 +196,7 @@ 

  

  BuildRequires: pkgconfig

  BuildRequires: readline-devel

+ BuildRequires: redhat-rpm-config >= 127

  BuildRequires: sqlite-devel

  BuildRequires: gdb

  
@@ -376,18 +377,16 @@ 

  # Descriptions, and metadata for subpackages

  # ==========================================

  

+ # People might want to dnf install pythonX.Y instead of pythonXY;

+ # we enable this in both flat and nonflat package.

+ Provides: python%{pybasever} = %{version}-%{release}

+ 

  %if %{without flatpackage}

  

  # Packages with Python modules in standard locations automatically

  # depend on python(abi). Provide that here.

  Provides: python(abi) = %{pybasever}

  

- # For backward compatibility only, remove in F29:

- Provides: system-python(abi) = %{pybasever}

- Provides: system-python = %{version}-%{release}

- Provides: system-python%{?_isa} = %{version}-%{release}

- Obsoletes: system-python < %{version}-%{release}

- 

  Requires: %{name}-libs%{?_isa} = %{version}-%{release}

  

  # In order to support multiple Python interpreters for development purposes,
@@ -447,20 +446,6 @@ 

  %package libs

  Summary:        Python runtime libraries

  

- # The "enum" module is included in the standard library.

- # Provide an upgrade path from the external library.

- Provides: python3-enum34 = 1.0.4-5%{?dist}

- Obsoletes: python3-enum34 < 1.0.4-5%{?dist}

- 

- # Python 3 built with glibc >= 2.24.90-26 needs to require it

- # See https://bugzilla.redhat.com/show_bug.cgi?id=1410644

- Requires: glibc%{?_isa} >= 2.24.90-26

- 

- %if %{with gdbm}

- # When built with this (as guarded by the BuildRequires above), require it

- Requires: gdbm-libs%{?_isa} >= 1:1.13

- %endif

- 

  %if %{with rpmwheels}

  Requires: python-setuptools-wheel

  Requires: python-pip-wheel
@@ -475,11 +460,6 @@ 

  # See https://bugzilla.redhat.com/show_bug.cgi?id=1547131

  Recommends: %{name}%{?_isa} = %{version}-%{release}

  

- # For backward compatibility only, remove in F29:

- Provides: system-python-libs = %{version}-%{release}

- Provides: system-python-libs%{?_isa} = %{version}-%{release}

- Obsoletes: system-python-libs < %{version}-%{release}

- 

  # Shall be removed in Fedora 31

  Obsoletes: platform-python-libs < %{platpyver}

  Obsoletes: platform-python-libs-devel < %{platpyver}
@@ -500,27 +480,11 @@ 

  Requires: python3-rpm-macros

  Requires: python3-rpm-generators

  

- # https://bugzilla.redhat.com/show_bug.cgi?id=1217376

- # https://bugzilla.redhat.com/show_bug.cgi?id=1496757

- # https://bugzilla.redhat.com/show_bug.cgi?id=1218294

- # TODO change to a specific subpackage once available (#1218294)

- Requires: redhat-rpm-config

- 

  Provides: %{name}-2to3 = %{version}-%{release}

  Provides: 2to3 = %{version}-%{release}

  

  Conflicts: %{name} < %{version}-%{release}

  

- # https://bugzilla.redhat.com/show_bug.cgi?id=1111275

- # /usr/bin/2to3 was moved from python2-tools to python3-tools

- # TODO Remove in Fedora 29

- Conflicts: python2-tools < 2.7.13-17

- Conflicts: python-tools < 2.7.13-17

- # https://bugzilla.redhat.com/show_bug.cgi?id=1312030

- # /usr/bin/2to3 was moved from python3-tools to python3-devel

- # TODO Remove in Fedora 30

- Conflicts: python3-tools < 3.6.4-14

- 

  # Shall be removed in Fedora 31

  Obsoletes: platform-python-devel < %{platpyver}

  
@@ -622,8 +586,6 @@ 

  

  %else  # with flatpackage

  

- Requires: redhat-rpm-config

- 

  # We'll not provide this, on purpose

  # No package in Fedora shall ever depend on flatpackage via this

  %global __requires_exclude ^python\\(abi\\) = 3\\..$
@@ -724,13 +686,21 @@ 

  %endif

  

  # Set common compiler/linker flags

- export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"

- export CXXFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"

+ # We utilize the %%extension_...flags macros here so users building C/C++

+ # extensions with our python won't get all the compiler/linker flags used

+ # in Fedora RPMs.

+ # Standard library built here will still use the %%build_...flags,

+ # Fedora packages utilizing %%py3_build will use them as well

+ # https://fedoraproject.org/wiki/Changes/Python_Extension_Flags

+ export CFLAGS="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"

+ export CFLAGS_NODIST="%{build_cflags} -D_GNU_SOURCE -fPIC -fwrapv"

+ export CXXFLAGS="%{extension_cxxflags} -D_GNU_SOURCE -fPIC -fwrapv"

  export CPPFLAGS="$(pkg-config --cflags-only-I libffi)"

- export OPT="$RPM_OPT_FLAGS -D_GNU_SOURCE -fPIC -fwrapv"

+ export OPT="%{extension_cflags} -D_GNU_SOURCE -fPIC -fwrapv"

  export LINKCC="gcc"

  export CFLAGS="$CFLAGS $(pkg-config --cflags openssl)"

- export LDFLAGS="$RPM_LD_FLAGS -g $(pkg-config --libs-only-L openssl)"

+ export LDFLAGS="%{extension_ldflags} -g $(pkg-config --libs-only-L openssl)"

+ export LDFLAGS_NODIST="%{build_ldflags} -g $(pkg-config --libs-only-L openssl)"

  

  # We can build several different configurations of Python: regular and debug.

  # Define a common function that does one build:
@@ -1002,13 +972,6 @@ 

    %{buildroot}%{_bindir}/python3-debug

  %endif

  

- # System Python: Link the executable to libexec

- # This is for backwards compatibility only and should be removed in Fedora 29

- %if %{without flatpackage}

- mkdir -p %{buildroot}%{_libexecdir}

- ln -s %{_bindir}/python%{pybasever} %{buildroot}%{_libexecdir}/system-python

- %endif

- 

  %if %{with flatpackage}

  # Remove stuff that would conflict with python3 package

  rm %{buildroot}%{_bindir}/python3
@@ -1121,8 +1084,6 @@ 

  %{_bindir}/pyvenv

  %{_mandir}/*/*

  %{_bindir}/pyvenv

- # Remove in Fedora 29:

- %{_libexecdir}/system-python

  %else

  %{_bindir}/pydoc%{pybasever}

  %{_mandir}/*/python%{pybasever}*
@@ -1570,6 +1531,10 @@ 

  # ======================================================

  

  %changelog

+ * Mon Feb 18 2019 Miro Hrončok <mhroncok@redhat.com> - 3.6.8-6

+ - Reduced default build flags used to build extension modules

+   https://fedoraproject.org/wiki/Changes/Python_Extension_Flags

+ 

  * Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 3.6.8-5

  - Rebuild for readline 8.0

  

no initial comment

Metadata Update from @churchyard:
- Request assigned

5 years ago

s390x failed due to infra problem.

rebased onto bcf86c3

5 years ago

The extension flags change works as expected. Extensions compiled on the system do not have the hardening flags, however the stdlib and the interpreter are properly compiled with those.

The rest of the changes are sane as well. Waiting on the CI to complete and I'll merge.

Ci keeps failing, but the errors seem unrelated to the change. Trying it once more.

The issue is with rawhide not having a compose right now. Merging as the rest is fine.

Pull-Request has been merged by cstratak

5 years ago