Update to 3.5.4

Removed patches due to being upstream: 250, 259, 267, 269

Added patch 264 to fix test_pass_by_value on aarch64 arch.

Added patch 273 to skip a test failure with glibc >= 2.26.90
This commit is contained in:
Charalampos Stratakis 2017-10-30 17:36:25 +01:00
parent f2a8e821f6
commit ff4d630818
8 changed files with 156 additions and 5883 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
Python-3.5.1.tar.xz
/Python-3.5.2.tar.xz
/Python-3.5.3.tar.xz
/Python-3.5.4.tar.xz

View File

@ -2,7 +2,7 @@ diff --git a/configure.ac b/configure.ac
index f50a6c8..b0650a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3277,6 +3277,23 @@ if test "$with_valgrind" != no; then
@@ -3288,6 +3288,23 @@ if test "$with_valgrind" != no; then
OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
fi
@ -39,7 +39,7 @@ index 0906ae0..4acd1cd 100755
THREADOBJ
LDLAST
USE_THREAD_MODULE
@@ -835,6 +837,7 @@ with_doc_strings
@@ -834,6 +836,7 @@ with_doc_strings
with_tsc
with_pymalloc
with_valgrind
@ -47,7 +47,7 @@ index 0906ae0..4acd1cd 100755
with_fpectl
with_libm
with_libc
@@ -1540,6 +1543,7 @@ Optional Packages:
@@ -1528,6 +1531,7 @@ Optional Packages:
--with(out)-tsc enable/disable timestamp counter profile
--with(out)-pymalloc disable/enable specialized mallocs
--with-valgrind Enable Valgrind support
@ -55,7 +55,7 @@ index 0906ae0..4acd1cd 100755
--with-fpectl enable SIGFPE catching
--with-libm=STRING math library
--with-libc=STRING C library
@@ -11181,6 +11185,31 @@ fi
@@ -11180,6 +11184,31 @@ fi
OPT="-DDYNAMIC_ANNOTATIONS_ENABLED=1 $OPT"
fi
@ -642,7 +642,7 @@ diff --git a/Makefile.pre.in b/Makefile.pre.in
index a88b7d5..3585b88 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -415,6 +415,7 @@ PYTHON_OBJS= \
@@ -383,6 +383,7 @@ PYTHON_OBJS= \
Python/formatter_unicode.o \
Python/fileutils.o \
Python/$(DYNLOADFILE) \
@ -650,19 +650,19 @@ index a88b7d5..3585b88 100644
$(LIBOBJS) \
$(MACHDEP_OBJS) \
$(THREADOBJ)
@@ -868,7 +869,8 @@ Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h
$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES)
$(PYTHON_FOR_GEN) $(OPCODETARGETGEN) $(OPCODETARGETS_H)
@@ -864,7 +865,8 @@ Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h
$(PYTHON_FOR_REGEN) $(srcdir)/Python/makeopcodetargets.py \
$(srcdir)/Python/opcode_targets.h
-Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h
+Python/ceval.o: $(OPCODETARGETS_H) $(srcdir)/Python/ceval_gil.h \
-Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h
+Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h \
+ $(srcdir)/Python/ceval_systemtap.h @SYSTEMTAPDEPS@
Python/frozen.o: Python/importlib.h Python/importlib_external.h
Python/frozen.o: $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib_external.h
@@ -876,6 +878,13 @@ Objects/typeobject.o: Objects/typeslots.inc
Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py
$(PYTHON_FOR_GEN) $(srcdir)/Objects/typeslots.py < $(srcdir)/Include/typeslots.h Objects/typeslots.inc
@@ -878,6 +880,13 @@ Objects/typeobject.o: Objects/typeslots.inc
< $(srcdir)/Include/typeslots.h \
$(srcdir)/Objects/typeslots.inc
+# Only needed with --with-systemtap; not a public header:
+$(srcdir)/Python/pysystemtap.h: $(srcdir)/Python/pysystemtap.d
@ -674,7 +674,7 @@ index a88b7d5..3585b88 100644
############################################################################
# Header files
@@ -1597,6 +1606,7 @@ clean: pycremoval
@@ -1601,6 +1610,7 @@ clean: pycremoval
-rm -f Lib/lib2to3/*Grammar*.pickle
-rm -f Programs/_testembed Programs/_freeze_importlib
-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
@ -720,7 +720,7 @@ index 7b40518..0e49de5 100644
co = f->f_code;
names = co->co_names;
consts = co->co_consts;
@@ -3640,6 +3646,11 @@ fast_yield:
@@ -3678,6 +3684,11 @@ fast_yield:
/* pop frame */
exit_eval_frame:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,118 @@
diff --git a/Lib/ctypes/test/test_as_parameter.py b/Lib/ctypes/test/test_as_parameter.py
index 2a3484bec01..a2640575a07 100644
--- a/Lib/ctypes/test/test_as_parameter.py
+++ b/Lib/ctypes/test/test_as_parameter.py
@@ -169,6 +169,10 @@ class S2H(Structure):
s2h = dll.ret_2h_func(self.wrap(inp))
self.assertEqual((s2h.x, s2h.y), (99*2, 88*3))
+ # Test also that the original struct was unmodified (i.e. was passed by
+ # value)
+ self.assertEqual((inp.x, inp.y), (99, 88))
+
def test_struct_return_8H(self):
class S8I(Structure):
_fields_ = [("a", c_int),
diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py
index 2e778fb1b43..d90c71144c9 100644
--- a/Lib/ctypes/test/test_structures.py
+++ b/Lib/ctypes/test/test_structures.py
@@ -417,6 +417,28 @@ class X(Structure):
self.assertEqual(s.second, 0xcafebabe)
self.assertEqual(s.third, 0x0bad1dea)
+ def test_pass_by_value_in_register(self):
+ class X(Structure):
+ _fields_ = [
+ ('first', c_uint),
+ ('second', c_uint)
+ ]
+
+ s = X()
+ s.first = 0xdeadbeef
+ s.second = 0xcafebabe
+ dll = CDLL(_ctypes_test.__file__)
+ func = dll._testfunc_reg_struct_update_value
+ func.argtypes = (X,)
+ func.restype = None
+ func(s)
+ self.assertEqual(s.first, 0xdeadbeef)
+ self.assertEqual(s.second, 0xcafebabe)
+ got = X.in_dll(dll, "last_tfrsuv_arg")
+ self.assertEqual(s.first, got.first)
+ self.assertEqual(s.second, got.second)
+
+
class PointerMemberTestCase(unittest.TestCase):
def test(self):
diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c
index fe0015c8013..2255e573393 100644
--- a/Modules/_ctypes/_ctypes_test.c
+++ b/Modules/_ctypes/_ctypes_test.c
@@ -57,6 +57,24 @@ _testfunc_large_struct_update_value(Test in)
((volatile Test *)&in)->third = 0x0badf00d;
}
+typedef struct {
+ unsigned int first;
+ unsigned int second;
+} TestReg;
+
+
+EXPORT(TestReg) last_tfrsuv_arg;
+
+
+EXPORT(void)
+_testfunc_reg_struct_update_value(TestReg in)
+{
+ last_tfrsuv_arg = in;
+ ((volatile TestReg *)&in)->first = 0x0badf00d;
+ ((volatile TestReg *)&in)->second = 0x0badf00d;
+}
+
+
EXPORT(void)testfunc_array(int values[4])
{
printf("testfunc_array %d %d %d %d\n",
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 0b6faf96c68..5439b939dc4 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -1039,6 +1039,13 @@ GetComError(HRESULT errcode, GUID *riid, IUnknown *pIunk)
}
#endif
+#if (defined(__x86_64__) && (defined(__MINGW64__) || defined(__CYGWIN__))) || \
+ defined(__aarch64__)
+#define CTYPES_PASS_BY_REF_HACK
+#define POW2(x) (((x & ~(x - 1)) == x) ? x : 0)
+#define IS_PASS_BY_REF(x) (x > 8 || !POW2(x))
+#endif
+
/*
* Requirements, must be ensured by the caller:
* - argtuple is tuple of arguments
@@ -1136,8 +1143,20 @@ PyObject *_ctypes_callproc(PPROC pProc,
}
for (i = 0; i < argcount; ++i) {
atypes[i] = args[i].ffi_type;
- if (atypes[i]->type == FFI_TYPE_STRUCT
- )
+#ifdef CTYPES_PASS_BY_REF_HACK
+ size_t size = atypes[i]->size;
+ if (IS_PASS_BY_REF(size)) {
+ void *tmp = alloca(size);
+ if (atypes[i]->type == FFI_TYPE_STRUCT)
+ memcpy(tmp, args[i].value.p, size);
+ else
+ memcpy(tmp, (void*)&args[i].value, size);
+
+ avalues[i] = tmp;
+ }
+ else
+#endif
+ if (atypes[i]->type == FFI_TYPE_STRUCT)
avalues[i] = (void *)args[i].value.p;
else
avalues[i] = (void *)&args[i].value;

View File

@ -1,78 +0,0 @@
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 3999d1f..c1e6566 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -328,13 +328,7 @@ def test_devnull_exists_and_is_empty(self):
with open(os.devnull, "rb") as f:
self.assertEqual(f.read(), b"")
- # Requesting pip fails without SSL (http://bugs.python.org/issue19744)
- @unittest.skipIf(ssl is None, ensurepip._MISSING_SSL_MESSAGE)
- @unittest.skipUnless(threading, 'some dependencies of pip import threading'
- ' module unconditionally')
- # Issue #26610: pip/pep425tags.py requires ctypes
- @unittest.skipUnless(ctypes, 'pip requires ctypes')
- def test_with_pip(self):
+ def do_test_with_pip(self, system_site_packages):
rmtree(self.env_dir)
with EnvironmentVarGuard() as envvars:
# pip's cross-version compatibility may trigger deprecation
@@ -368,6 +362,7 @@ def test_with_pip(self):
# config in place to ensure we ignore it
try:
self.run_with_capture(venv.create, self.env_dir,
+ system_site_packages=system_site_packages,
with_pip=True)
except subprocess.CalledProcessError as exc:
# The output this produces can be a little hard to read,
@@ -417,9 +412,21 @@ def test_with_pip(self):
out = out.decode("latin-1") # Force to text, prevent decoding errors
self.assertIn("Successfully uninstalled pip", out)
self.assertIn("Successfully uninstalled setuptools", out)
- # Check pip is now gone from the virtual environment
- self.assert_pip_not_installed()
+ # Check pip is now gone from the virtual environment. This only
+ # applies in the system_site_packages=False case, because in the
+ # other case, pip may still be available in the system site-packages
+ if not system_site_packages:
+ self.assert_pip_not_installed()
+ # Requesting pip fails without SSL (http://bugs.python.org/issue19744)
+ @unittest.skipIf(ssl is None, ensurepip._MISSING_SSL_MESSAGE)
+ @unittest.skipUnless(threading, 'some dependencies of pip import threading'
+ ' module unconditionally')
+ # Issue #26610: pip/pep425tags.py requires ctypes
+ @unittest.skipUnless(ctypes, 'pip requires ctypes')
+ def test_with_pip(self):
+ self.do_test_with_pip(False)
+ self.do_test_with_pip(True)
if __name__ == "__main__":
unittest.main()
diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py
index 74245ab..fa03262 100644
--- a/Lib/venv/__init__.py
+++ b/Lib/venv/__init__.py
@@ -77,6 +77,10 @@ def create(self, env_dir):
"""
env_dir = os.path.abspath(env_dir)
context = self.ensure_directories(env_dir)
+ # See issue 24875. We need system_site_packages to be False
+ # until after pip is installed.
+ true_system_site_packages = self.system_site_packages
+ self.system_site_packages = False
self.create_configuration(context)
self.setup_python(context)
if self.with_pip:
@@ -84,6 +88,11 @@ def create(self, env_dir):
if not self.upgrade:
self.setup_scripts(context)
self.post_setup(context)
+ if true_system_site_packages:
+ # We had set it to False before, now
+ # restore it and rewrite the configuration
+ self.system_site_packages = True
+ self.create_configuration(context)
def clear_directory(self, path):
for fn in os.listdir(path):

View File

@ -1,67 +0,0 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 0e1d0af..42ab191 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -989,7 +989,7 @@ TESTTIMEOUT= 1200
# Run a basic set of regression tests.
# This excludes some tests that are particularly resource-intensive.
-test: all platform
+test: @DEF_MAKE_RULE@ platform
$(TESTRUNNER) $(TESTOPTS)
# Run the full test suite twice - once without .pyc files, and once with.
@@ -999,7 +999,7 @@ test: all platform
# the bytecode read from a .pyc file had the bug, sometimes the directly
# generated bytecode. This is sometimes a very shy bug needing a lot of
# sample data.
-testall: all platform
+testall: @DEF_MAKE_RULE@ platform
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
$(TESTPYTHON) -E $(srcdir)/Lib/compileall.py
-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
@@ -1008,7 +1008,7 @@ testall: all platform
# Run the test suite for both architectures in a Universal build on OSX.
# Must be run on an Intel box.
-testuniversal: all platform
+testuniversal: @DEF_MAKE_RULE@ platform
if [ `arch` != 'i386' ];then \
echo "This can only be used on OSX/i386" ;\
exit 1 ;\
@@ -1031,7 +1031,7 @@ QUICKTESTOPTS= $(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
test_multiprocessing_forkserver \
test_mailbox test_socket test_poll \
test_select test_zipfile test_concurrent_futures
-quicktest: all platform
+quicktest: @DEF_MAKE_RULE@ platform
$(TESTRUNNER) $(QUICKTESTOPTS)
@@ -1368,7 +1368,7 @@ LIBPL= $(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH)
# pkgconfig directory
LIBPC= $(LIBDIR)/pkgconfig
-libainstall: all python-config
+libainstall: @DEF_MAKE_RULE@ python-config
@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
do \
if test ! -d $(DESTDIR)$$i; then \
@@ -1616,7 +1616,7 @@ distclean: clobber
-exec rm -f {} ';'
# Check for smelly exported symbols (not starting with Py/_Py)
-smelly: all
+smelly: @DEF_MAKE_RULE@
nm -p $(LIBRARY) | \
sed -n "/ [TDB] /s/.* //p" | grep -v "^_*Py" | sort -u; \
@@ -1653,7 +1653,7 @@ funny:
-o -print
# Perform some verification checks on any modified files.
-patchcheck: all
+patchcheck: @DEF_MAKE_RULE@
$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
# Dependencies

View File

@ -97,8 +97,8 @@
# ==================
Summary: Version 3.5 of the Python programming language
Name: python%{pyshortver}
Version: %{pybasever}.3
Release: 5%{?dist}
Version: %{pybasever}.4
Release: 1%{?dist}
License: Python
Group: Development/Languages
@ -366,32 +366,13 @@ Patch206: 00206-remove-hf-from-arm-triplet.patch
# Fedora needs the default mips64-linux-gnu
Patch243: 00243-fix-mips64-triplet.patch
# 00250 #
# After glibc-2.24.90, Python 3 failed to start on EL7 kernel
# rhbz#1410175: https://bugzilla.redhat.com/show_bug.cgi?id=1410175
# http://bugs.python.org/issue29157
Patch250: 00250-getentropy.patch
# 00259 #
# Tolerate legacy invalid bytecode
# This patch restores the ability to import legacy bytecode generated
# by 3.5.0, 3.5.1 or 3.5.2, and modifies the eval loop to
# avoid any harmful consequences from the potentially malformed legacy
# bytecode.
# Original import patch by Petr Viktorin, eval loop patch by Serhiy Storchaka,
# and tests and integration by Nick Coghlan.
Patch259: 00259-tolerate-legacy-invalid-bytecode.patch
# 00267 #
# Make pip installable inside a new venv when using the --system-site-packages flag
# FIXED UPSTREAM: https://bugs.python.org/issue24875
Patch267: 00267-install-pip-in-a-venv-with-system-site-packages.patch
# 00269 #
# Fix python's recompilation with common build commands when using
# profile guided optimizations.
# Fixed upstream: http://bugs.python.org/issue29243
Patch269: 00269-fix-multiple-compilations-issue-with-pgo-builds.patch
# 00264 #
# test_pass_by_value was added in Python 3.5.4 and on aarch64
# it is catching an error that was there, but wasn't tested before.
# Since the Python 3.5 branch is on security bug fix mode only
# we backport the fix from the master branch.
# Fixed upstream: http://bugs.python.org/issue29804
Patch264: 00264-fix-test-failing-on-aarch64.patch
# 00270 #
# Fix test_alpn_protocols from test_ssl as openssl > 1.1.0f
@ -399,6 +380,12 @@ Patch269: 00269-fix-multiple-compilations-issue-with-pgo-builds.patch
# Fixed upstream: http://bugs.python.org/issue30714
Patch270: 00270-fix-ssl-alpn-hook-test.patch
# 00273 #
# Skip test_float_with_comma, which fails in Koji with UnicodeDecodeError
# See https://bugzilla.redhat.com/show_bug.cgi?id=1484497
# Reported upstream: https://bugs.python.org/issue31900
Patch273: 00273-skip-float-test.patch
# (New patches go here ^^^)
#
# When adding new patches to "python" and "python3" in Fedora, EL, etc.,
@ -510,11 +497,9 @@ rm -r Modules/zlib || exit 1
%patch205 -p1
%patch206 -p1
%patch243 -p1
%patch250 -p1
%patch259 -p1
%patch267 -p1
%patch269 -p1
%patch264 -p1
%patch270 -p1
%patch273 -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.
@ -1049,6 +1034,9 @@ CheckPython optimized
# ======================================================
%changelog
* Mon Oct 30 2017 Charalampos Stratakis <cstratak@redhat.com> - 3.5.4-1
- Rebased to version 3.5.4
* Mon Aug 14 2017 David "Sanqui" Labský <dlabsky@redhat.com> - 3.5.3-5
- Drop unused db4-devel dependency

View File

@ -1 +1 @@
SHA512 (Python-3.5.3.tar.xz) = bbcc20e315c63dbc8901d7e7bfa29d4dbdad9335720757d8d679730319fd1d9fcfdb55cf62d620c9b052134170f162c28d653a8af60923185b8932524d827864
SHA512 (Python-3.5.4.tar.xz) = dbbe2740ee1cce5404b7b6436a9b3887e15f415a1006efa22014ec7e5b1e48c43eed0ff98f6f5b365c527b8d2525be4ce72bbe404ce71c0835529fcd6f0267ff