summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patches/01_all_static_library_location.patch4
-rw-r--r--patches/03_all_libdir.patch44
-rw-r--r--patches/05_all_regenerate_platform-specific_modules.patch12
-rw-r--r--patches/21_all_distutils_c++.patch44
-rw-r--r--patches/22_all_tests_environment.patch71
5 files changed, 87 insertions, 88 deletions
diff --git a/patches/01_all_static_library_location.patch b/patches/01_all_static_library_location.patch
index 580c03f..ea5d29a 100644
--- a/patches/01_all_static_library_location.patch
+++ b/patches/01_all_static_library_location.patch
@@ -4,7 +4,7 @@ https://bugs.python.org/issue6103
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -1024,6 +1024,19 @@
+@@ -1039,6 +1039,19 @@
$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
$$ensurepip --root=$(DESTDIR)/ ; \
fi
@@ -24,7 +24,7 @@ https://bugs.python.org/issue6103
commoninstall: @FRAMEWORKALTINSTALLFIRST@ \
altbininstall libinstall inclinstall libainstall \
-@@ -1357,18 +1370,6 @@
+@@ -1372,18 +1385,6 @@
else true; \
fi; \
done
diff --git a/patches/03_all_libdir.patch b/patches/03_all_libdir.patch
index 3ab5501..cd51920 100644
--- a/patches/03_all_libdir.patch
+++ b/patches/03_all_libdir.patch
@@ -1,14 +1,3 @@
---- configure.ac
-+++ configure.ac
-@@ -4331,7 +4331,7 @@
-
- dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
- AC_SUBST(PY_ENABLE_SHARED)
--LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
-+LIBPL='$(prefix)'"/@@GENTOO_LIBDIR@@/python${VERSION}/config-${LDVERSION}"
- AC_SUBST(LIBPL)
-
- # Check whether right shifting a negative integer extends the sign bit
--- Lib/distutils/command/install.py
+++ Lib/distutils/command/install.py
@@ -29,8 +29,8 @@
@@ -89,7 +78,7 @@
else:
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -120,7 +120,7 @@
+@@ -125,7 +125,7 @@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
@@ -98,6 +87,17 @@
ABIFLAGS= @ABIFLAGS@
# Detailed destination directories
+--- Modules/Setup.dist
++++ Modules/Setup.dist
+@@ -358,7 +358,7 @@
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/@@GENTOO_LIBDIR@@ -lz
+
+ # Interface to the Expat XML parser
+ #
--- Modules/getpath.c
+++ Modules/getpath.c
@@ -118,8 +118,8 @@
@@ -138,17 +138,17 @@
}
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
---- Modules/Setup.dist
-+++ Modules/Setup.dist
-@@ -358,7 +358,7 @@
- # Andrew Kuchling's zlib module.
- # This require zlib 1.1.3 (or later).
- # See http://www.gzip.org/zlib/
--#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
-+#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/@@GENTOO_LIBDIR@@ -lz
+--- configure.ac
++++ configure.ac
+@@ -4374,7 +4374,7 @@
- # Interface to the Expat XML parser
- #
+ dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
+ AC_SUBST(PY_ENABLE_SHARED)
+-LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
++LIBPL='$(prefix)'"/@@GENTOO_LIBDIR@@/python${VERSION}/config-${LDVERSION}"
+ AC_SUBST(LIBPL)
+
+ # Check whether right shifting a negative integer extends the sign bit
--- setup.py
+++ setup.py
@@ -480,7 +480,7 @@
diff --git a/patches/05_all_regenerate_platform-specific_modules.patch b/patches/05_all_regenerate_platform-specific_modules.patch
index fc7b95d..a351e1e 100644
--- a/patches/05_all_regenerate_platform-specific_modules.patch
+++ b/patches/05_all_regenerate_platform-specific_modules.patch
@@ -37,16 +37,16 @@ https://bugs.python.org/issue12619
+python$EXE ../../Tools/scripts/h2py.py /usr/include/sys/stropts.h
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -475,7 +475,7 @@
+@@ -479,7 +479,7 @@
# Default target
all: build_all
-build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Programs/_testembed python-config
+build_all: $(BUILDPYTHON) oldsharedmods sharedmods platformspecificmods gdbhooks Programs/_testembed python-config
- # Compile a binary with gcc profile guided optimization.
+ # Compile a binary with profile guided optimization.
profile-opt:
-@@ -584,6 +584,32 @@
+@@ -599,6 +599,32 @@
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
@@ -79,7 +79,7 @@ https://bugs.python.org/issue12619
# Build static library
# avoid long command lines, same as LIBRARY_OBJS
$(LIBRARY): $(LIBRARY_OBJS)
-@@ -1213,7 +1239,7 @@
+@@ -1228,7 +1254,7 @@
unittest unittest/test unittest/test/testmock \
venv venv/scripts venv/scripts/posix \
curses pydoc_data $(MACHDEPS)
@@ -88,7 +88,7 @@ https://bugs.python.org/issue12619
@for i in $(SCRIPTDIR) $(LIBDEST); \
do \
if test ! -d $(DESTDIR)$$i; then \
-@@ -1305,23 +1331,6 @@
+@@ -1320,23 +1346,6 @@
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
@@ -112,7 +112,7 @@ https://bugs.python.org/issue12619
python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
# Substitution happens here, as the completely-expanded BINDIR
# is not available in configure
-@@ -1647,7 +1656,7 @@
+@@ -1664,7 +1673,7 @@
Python/thread.o: @THREADHEADERS@
# Declare targets that aren't real files
diff --git a/patches/21_all_distutils_c++.patch b/patches/21_all_distutils_c++.patch
index cda8987..8a3fa63 100644
--- a/patches/21_all_distutils_c++.patch
+++ b/patches/21_all_distutils_c++.patch
@@ -1,5 +1,26 @@
https://bugs.python.org/issue1222585
+--- Lib/_osx_support.py
++++ Lib/_osx_support.py
+@@ -14,13 +14,13 @@
+ # configuration variables that may contain universal build flags,
+ # like "-arch" or "-isdkroot", that may need customization for
+ # the user environment
+-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
+- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
+- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
+- 'PY_CORE_CFLAGS')
++_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS',
++ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED',
++ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS',
++ 'PY_CPPFLAGS', 'PY_CORE_CFLAGS')
+
+ # configuration variables that may contain compiler calls
+-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
++_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX')
+
+ # prefix added to original configuration variable names
+ _INITPRE = '_OSX_SUPPORT_INITIAL_'
--- Lib/distutils/cygwinccompiler.py
+++ Lib/distutils/cygwinccompiler.py
@@ -125,8 +125,10 @@
@@ -206,30 +227,9 @@ https://bugs.python.org/issue1222585
if sys.platform == 'darwin':
linker = _osx_support.compiler_fixup(linker, ld_args)
---- Lib/_osx_support.py
-+++ Lib/_osx_support.py
-@@ -14,13 +14,13 @@
- # configuration variables that may contain universal build flags,
- # like "-arch" or "-isdkroot", that may need customization for
- # the user environment
--_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
-- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
-- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
-- 'PY_CORE_CFLAGS')
-+_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS',
-+ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED',
-+ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS',
-+ 'PY_CPPFLAGS', 'PY_CORE_CFLAGS')
-
- # configuration variables that may contain compiler calls
--_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')
-+_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX')
-
- # prefix added to original configuration variable names
- _INITPRE = '_OSX_SUPPORT_INITIAL_'
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -580,7 +580,7 @@
+@@ -595,7 +595,7 @@
*\ -s*|s*) quiet="-q";; \
*) quiet="";; \
esac; \
diff --git a/patches/22_all_tests_environment.patch b/patches/22_all_tests_environment.patch
index 11a5f22..5f8d80d 100644
--- a/patches/22_all_tests_environment.patch
+++ b/patches/22_all_tests_environment.patch
@@ -2,7 +2,7 @@ https://bugs.python.org/issue1674555
--- Lib/site.py
+++ Lib/site.py
-@@ -544,8 +544,12 @@
+@@ -546,8 +546,12 @@
known_paths = venv(known_paths)
if ENABLE_USER_SITE is None:
ENABLE_USER_SITE = check_enableusersite()
@@ -27,33 +27,33 @@ https://bugs.python.org/issue1674555
try:
import threading
-@@ -432,7 +433,6 @@
+@@ -434,7 +435,6 @@
subprocess exits, its return code, stdout and stderr are returned as a
3-tuple.
"""
- from subprocess import Popen, PIPE
base_cmd = ([sys.executable] + support.args_from_interpreter_flags() +
['-X', 'faulthandler', '-m', 'test.regrtest'])
-
-@@ -643,6 +643,56 @@
+ # required to spawn a new process with PGO flag on/off
+@@ -657,9 +657,62 @@
support.use_resources = ns.use_resources
save_modules = sys.modules.keys()
-+ opt_args = support.args_from_interpreter_flags()
-+ base_cmd = [sys.executable] + opt_args
-+ base_cmd += ['-X', 'faulthandler', '-m', 'test.regrtest']
-+ debug_output_pat = re.compile(r"\[\d+ refs, \d+ blocks\]$")
-+
+ def _runtest(test, verbose, quiet, huntrleaks=False, use_resources=None,
+ output_on_failure=False, failfast=False, match_tests=None,
-+ timeout=None):
++ timeout=None, *, pgo=False):
+ if test == "test_site":
++ base_cmd = ([sys.executable] + support.args_from_interpreter_flags() +
++ ['-X', 'faulthandler', '-m', 'test.regrtest'])
++ # required to spawn a new process with PGO flag on/off
++ if pgo:
++ base_cmd = base_cmd + ['--pgo']
+ slaveargs = ((test, verbose, quiet),
+ dict(huntrleaks=huntrleaks,
+ use_resources=use_resources,
+ output_on_failure=output_on_failure,
+ timeout=timeout, failfast=failfast,
-+ match_tests=match_tests))
++ match_tests=match_tests, pgo=pgo))
+ env = os.environ.copy()
+ try:
+ del env["_PYTHONNOSITEPACKAGES"]
@@ -63,23 +63,26 @@ https://bugs.python.org/issue1674555
+ stdout=PIPE, stderr=PIPE,
+ universal_newlines=True,
+ close_fds=(os.name != 'nt'),
++ cwd=support.SAVEDCWD,
+ env=env)
+ stdout, stderr = popen.communicate()
+ retcode = popen.wait()
-+ # Strip last refcount output line if it exists, since it
-+ # comes from the shutdown of the interpreter in the subcommand.
-+ stderr = debug_output_pat.sub("", stderr)
+ stdout, _, result = stdout.strip().rpartition("\n")
+ if retcode != 0:
-+ result = (CHILD_ERROR, "Exit code %s" % retcode)
++ result = (CHILD_ERROR, None)
+ else:
++ if not result:
++ return (None, None)
+ result = json.loads(result)
++ stdout = stdout.rstrip()
++ stderr = stderr.rstrip()
+ if stdout:
+ print(stdout)
-+ if stderr:
++ if stderr and not pgo:
+ print(stderr, file=sys.stderr)
++ sys.stdout.flush()
++ sys.stderr.flush()
+ if result[0] == INTERRUPTED:
-+ assert result[1] == 'KeyboardInterrupt'
+ raise KeyboardInterrupt
+ return result
+ else:
@@ -87,20 +90,16 @@ https://bugs.python.org/issue1674555
+ use_resources=use_resources,
+ output_on_failure=output_on_failure,
+ failfast=failfast, match_tests=match_tests,
-+ timeout=timeout)
++ timeout=timeout, pgo=pgo)
+
def accumulate_result(test, result):
ok, test_time = result
- test_times.append((test_time, test))
-@@ -680,7 +730,6 @@
- print("Multiprocess option requires thread support")
- sys.exit(2)
- from queue import Queue
-- debug_output_pat = re.compile(r"\[\d+ refs, \d+ blocks\]$")
- output = Queue()
- pending = MultiprocessTests(tests)
- def work():
-@@ -752,15 +801,15 @@
+- if ok not in (CHILD_ERROR, INTERRUPTED):
++ if ok not in (None, CHILD_ERROR, INTERRUPTED):
+ test_times.append((test_time, test))
+ if ok == PASSED:
+ good.append(test)
+@@ -773,15 +826,15 @@
if ns.trace:
# If we're tracing code coverage, then we don't exit with status
# if on a false return value from main.
@@ -113,27 +112,27 @@ https://bugs.python.org/issue1674555
- ns.huntrleaks,
- output_on_failure=ns.verbose3,
- timeout=ns.timeout, failfast=ns.failfast,
-- match_tests=ns.match_tests)
+- match_tests=ns.match_tests, pgo=ns.pgo)
+ result = _runtest(test, ns.verbose, ns.quiet,
+ ns.huntrleaks,
+ output_on_failure=ns.verbose3,
+ timeout=ns.timeout, failfast=ns.failfast,
-+ match_tests=ns.match_tests)
++ match_tests=ns.match_tests, pgo=ns.pgo)
accumulate_result(test, result)
except KeyboardInterrupt:
interrupted = True
-@@ -813,8 +862,8 @@
+@@ -835,8 +888,8 @@
sys.stdout.flush()
try:
ns.verbose = True
- ok = runtest(test, True, ns.quiet, ns.huntrleaks,
-- timeout=ns.timeout)
+- timeout=ns.timeout, pgo=ns.pgo)
+ ok = _runtest(test, True, ns.quiet, ns.huntrleaks,
-+ timeout=ns.timeout)
++ timeout=ns.timeout, pgo=ns.pgo)
except KeyboardInterrupt:
# print a newline separate from the ^C
print()
-@@ -1236,8 +1285,9 @@
+@@ -1260,8 +1313,9 @@
for name, get, restore in self.resource_info():
current = get()
original = saved_values.pop(name)
@@ -144,7 +143,7 @@ https://bugs.python.org/issue1674555
+ if current != original and self.testname != "test_site":
self.changed = True
restore(original)
- if not self.quiet:
+ if not self.quiet and not self.pgo:
--- Lib/test/test_site.py
+++ Lib/test/test_site.py
@@ -8,6 +8,7 @@
@@ -180,7 +179,7 @@ https://bugs.python.org/issue1674555
stdout, stderr = popen.communicate()
--- Makefile.pre.in
+++ Makefile.pre.in
-@@ -979,7 +979,7 @@
+@@ -994,7 +994,7 @@
######################################################################
TESTOPTS= $(EXTRATESTOPTS)