summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patches/01_all_static_library_location.patch2
-rw-r--r--patches/03_all_libdir.patch42
-rw-r--r--patches/05_all_regenerate_platform-specific_modules.patch6
-rw-r--r--patches/21_all_distutils_c++.patch42
-rw-r--r--patches/22_all_tests_environment.patch45
-rw-r--r--patches/24_all_expat-2.2.patch19
6 files changed, 86 insertions, 70 deletions
diff --git a/patches/01_all_static_library_location.patch b/patches/01_all_static_library_location.patch
index 67d1873..844d748 100644
--- a/patches/01_all_static_library_location.patch
+++ b/patches/01_all_static_library_location.patch
@@ -24,7 +24,7 @@ https://bugs.python.org/issue6103
commoninstall: @FRAMEWORKALTINSTALLFIRST@ \
altbininstall libinstall inclinstall libainstall \
-@@ -1325,18 +1338,6 @@
+@@ -1324,18 +1337,6 @@
else true; \
fi; \
done
diff --git a/patches/03_all_libdir.patch b/patches/03_all_libdir.patch
index c07a6ff..0383210 100644
--- a/patches/03_all_libdir.patch
+++ b/patches/03_all_libdir.patch
@@ -95,6 +95,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 @@
@@ -135,17 +146,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
+@@ -4115,7 +4115,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
@@ -462,7 +462,7 @@
@@ -223,14 +234,3 @@
# If Cygwin, then verify that X is installed before proceeding
if host_platform == 'cygwin':
---- configure.ac
-+++ configure.ac
-@@ -4374,7 +4374,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
diff --git a/patches/05_all_regenerate_platform-specific_modules.patch b/patches/05_all_regenerate_platform-specific_modules.patch
index 6e985f3..4b69bcc 100644
--- a/patches/05_all_regenerate_platform-specific_modules.patch
+++ b/patches/05_all_regenerate_platform-specific_modules.patch
@@ -79,7 +79,7 @@ https://bugs.python.org/issue12619
# Build static library
# avoid long command lines, same as LIBRARY_OBJS
$(LIBRARY): $(LIBRARY_OBJS)
-@@ -1190,7 +1216,7 @@
+@@ -1189,7 +1215,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 \
-@@ -1273,23 +1299,6 @@
+@@ -1272,23 +1298,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
-@@ -1615,7 +1624,7 @@
+@@ -1614,7 +1623,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 cf81742..86dca9a 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,27 +227,6 @@ 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
@@ -569,7 +569,7 @@
diff --git a/patches/22_all_tests_environment.patch b/patches/22_all_tests_environment.patch
index 6eb75f8..017bb86 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
-@@ -545,8 +545,12 @@
+@@ -547,8 +547,12 @@
known_paths = venv(known_paths)
if ENABLE_USER_SITE is None:
ENABLE_USER_SITE = check_enableusersite()
@@ -35,19 +35,16 @@ https://bugs.python.org/issue1674555
base_cmd = ([sys.executable] + support.args_from_interpreter_flags() +
['-X', 'faulthandler', '-m', 'test.regrtest'])
-@@ -643,6 +643,56 @@
+@@ -643,9 +643,60 @@
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):
+ if test == "test_site":
++ base_cmd = ([sys.executable] + support.args_from_interpreter_flags() +
++ ['-X', 'faulthandler', '-m', 'test.regrtest'])
+ slaveargs = ((test, verbose, quiet),
+ dict(huntrleaks=huntrleaks,
+ use_resources=use_resources,
@@ -63,23 +60,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:
+ print(stderr, file=sys.stderr)
++ sys.stdout.flush()
++ sys.stderr.flush()
+ if result[0] == INTERRUPTED:
-+ assert result[1] == 'KeyboardInterrupt'
+ raise KeyboardInterrupt
+ return result
+ else:
@@ -91,16 +91,13 @@ https://bugs.python.org/issue1674555
+
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 @@
+- test_times.append((test_time, test))
++ if ok not in (None, CHILD_ERROR, INTERRUPTED):
++ test_times.append((test_time, test))
+ if ok == PASSED:
+ good.append(test)
+ elif ok == FAILED:
+@@ -752,15 +803,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.
@@ -122,7 +119,7 @@ https://bugs.python.org/issue1674555
accumulate_result(test, result)
except KeyboardInterrupt:
interrupted = True
-@@ -817,8 +866,8 @@
+@@ -815,8 +866,8 @@
sys.stdout.flush()
try:
ns.verbose = True
@@ -133,7 +130,7 @@ https://bugs.python.org/issue1674555
except KeyboardInterrupt:
# print a newline separate from the ^C
print()
-@@ -1239,8 +1288,9 @@
+@@ -1238,8 +1289,9 @@
for name, get, restore in self.resource_info():
current = get()
original = saved_values.pop(name)
diff --git a/patches/24_all_expat-2.2.patch b/patches/24_all_expat-2.2.patch
new file mode 100644
index 0000000..34d1ecd
--- /dev/null
+++ b/patches/24_all_expat-2.2.patch
@@ -0,0 +1,19 @@
+https://bugs.python.org/issue27369
+https://hg.python.org/cpython/rev/17ec4d58c046
+
+--- Lib/test/test_pyexpat.py
++++ Lib/test/test_pyexpat.py
+@@ -662,11 +662,9 @@
+ # \xc2\x85 is UTF-8 encoded U+0085 (NEXT LINE)
+ xml = b"<?xml version\xc2\x85='1.0'?>\r\n"
+ parser = expat.ParserCreate()
+- try:
++ err_pattern = r'XML declaration not well-formed: line 1, column \d+'
++ with self.assertRaisesRegex(expat.ExpatError, err_pattern):
+ parser.Parse(xml, True)
+- self.fail()
+- except expat.ExpatError as e:
+- self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14')
+
+ class ErrorMessageTest(unittest.TestCase):
+ def test_codes(self):