Avoid truncated _math.o files caused by parallel builds

rhbz#1292461

disable failing test_with_pip (test.test_venv.EnsurePipTest) on ppc64*

Use a larger stack size on ppc64 (rhbz#1292462)
This commit is contained in:
Karsten Hopp 2015-12-21 15:55:55 +01:00
parent e06dbe093e
commit e3c54b7595
3 changed files with 84 additions and 0 deletions

56
00207-math-once.patch Normal file
View File

@ -0,0 +1,56 @@
--- Python-3.5.1/Makefile.pre.in.kh 2015-12-17 05:51:08.466546157 -0500
+++ Python-3.5.1/Makefile.pre.in 2015-12-17 05:52:26.207761635 -0500
@@ -587,11 +587,15 @@ pybuilddir.txt: $(BUILDPYTHON)
exit 1 ; \
fi
+# This is shared by the math and cmath modules
+Modules/_math.o: Modules/_math.c Modules/_math.h
+ $(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $<
+
# Build the shared modules
# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
# -s, --silent or --quiet is always the first char.
# Under BSD make, MAKEFLAGS might be " -s -v x=y".
-sharedmods: $(BUILDPYTHON) pybuilddir.txt
+sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
@case "$$MAKEFLAGS" in \
*\ -s*|s*) quiet="-q";; \
*) quiet="";; \
--- Python-3.5.1/Misc/NEWS.kh 2015-12-17 05:53:40.898929946 -0500
+++ Python-3.5.1/Misc/NEWS 2015-12-17 05:54:28.599676136 -0500
@@ -464,6 +464,10 @@ Build
- Issue #24986: It is now possible to build Python on Windows without errors
when external libraries are not available.
+- Issue #24421: Compile Modules/_math.c once, before building extensions.
+ Previously it could fail to compile properly if the math and cmath builds
+ were concurrent.
+
Windows
-------
--- Python-3.5.1/setup.py.kh 2015-12-17 06:38:30.950955607 -0500
+++ Python-3.5.1/setup.py 2015-12-17 06:42:32.074722493 -0500
@@ -582,13 +582,17 @@ class PyBuildExt(build_ext):
# array objects
exts.append( Extension('array', ['arraymodule.c']) )
+
+ shared_math = 'Modules/_math.o'
# complex math library functions
- exts.append( Extension('cmath', ['cmathmodule.c', '_math.c'],
- depends=['_math.h'],
+ exts.append( Extension('cmath', ['cmathmodule.c'],
+ extra_objects=[shared_math],
+ depends=['_math.h', shared_math],
libraries=math_libs) )
# math library functions, e.g. sin()
- exts.append( Extension('math', ['mathmodule.c', '_math.c'],
- depends=['_math.h'],
+ exts.append( Extension('math', ['mathmodule.c'],
+ extra_objects=[shared_math],
+ depends=['_math.h', shared_math],
libraries=math_libs) )
# time libraries: librt may be needed for clock_gettime()

View File

@ -0,0 +1,11 @@
diff -up Python-3.5.1/Lib/test/test_venv.py.1292467 Python-3.5.1/Lib/test/test_venv.py
--- Python-3.5.1/Lib/test/test_venv.py.1292467 2015-12-21 13:37:44.740190595 +0100
+++ Python-3.5.1/Lib/test/test_venv.py 2015-12-21 13:40:25.707911828 +0100
@@ -319,6 +319,7 @@ class EnsurePipTest(BaseTest):
# Requesting pip fails without SSL (http://bugs.python.org/issue19744)
@unittest.skipIf(ssl is None, ensurepip._MISSING_SSL_MESSAGE)
+ @unittest.skip('rhbz#1292467')
def test_with_pip(self):
rmtree(self.env_dir)
with EnvironmentVarGuard() as envvars:

View File

@ -464,6 +464,15 @@ Patch205: 00205-make-libpl-respect-lib64.patch
# by debian but fedora infra uses only eabi without hf
Patch206: 00206-remove-hf-from-arm-triplet.patch
# Avoid truncated _math.o files caused by parallel builds
# modified version of https://bugs.python.org/issue24421
# rhbz#1292461
Patch207: 00207-math-once.patch
# test_with_pip (test.test_venv.EnsurePipTest) fails on ppc64*
# rhbz#1292467
Patch208: 00208-disable-test_with_pip-on-ppc.patch
# add correct arch for ppc64/ppc64le
# it should be ppc64le-linux-gnu/ppc64-linux-gnu instead powerpc64le-linux-gnu/powerpc64-linux-gnu
Patch5001: python3-powerppc-arch.patch
@ -679,6 +688,8 @@ sed -r -i s/'_PIP_VERSION = "[0-9.]+"'/'_PIP_VERSION = "%{pip_version}"'/ Lib/en
%patch203 -p1
%patch205 -p1
%patch206 -p1
%patch207 -p1
%patch208 -p1
# Currently (2010-01-15), http://docs.python.org/library is for 2.6, and there
# are many differences between 2.6 and the Python 3 library.
@ -706,6 +717,7 @@ export LINKCC="gcc"
export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
export LDFLAGS="$RPM_LD_FLAGS `pkg-config --libs-only-L openssl`"
# Define a function, for how to perform a "build" of python for a given
# configuration:
BuildPython() {
@ -1087,6 +1099,11 @@ find %{buildroot} -type f -a -name "*.py" -print0 | \
PYTHONPATH="%{buildroot}%{_libdir}/python%{pybasever} %{buildroot}%{_libdir}/python%{pybasever}/site-packages" \
xargs -0 %{buildroot}%{_bindir}/python%{pybasever} %{SOURCE8}
# For ppc64 we need a larger stack than default (rhbz#1292462)
%ifarch %{power64}
ulimit -a
ulimit -s 16384
%endif
topdir=$(pwd)
CheckPython() {