Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Aug 2014 03:53:25 +0000 (UTC)
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r365708 - in head/lang: python27/files python33/files python34/files
Message-ID:  <201408230353.s7N3rPYZ052104@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: koobs
Date: Sat Aug 23 03:53:25 2014
New Revision: 365708
URL: http://svnweb.freebsd.org/changeset/ports/365708
QAT: https://qat.redports.org/buildarchive/r365708/

Log:
  lang/python{27,33,34}: Backport fix for upstream Issue #21166
  
  Backport fix for upstream Issue #21166:
  
  Prevent possible segfaults and other random failures of python
  --generate-posix-vars in pybuilddir.txt build target by ensuring
  that pybuilddir.txt is always regenerated when configure is run and
  that the newly built skeleton python does not inadvertently import
  modules from previously installed instances. [1]
  
  This changeset has been committed for release in 2.7.9, 3.4.2, and 3.5.0.
  
  A HUGE thank you to Ned Deily from the Python Core Development Team
  for helping to identify the underlying cause, produce a fix and
  wonderfully document the explanation.
  
  [1] http://bugs.python.org/issue21166

Added:
  head/lang/python27/files/patch-issue21166   (contents, props changed)
  head/lang/python33/files/patch-issue21166   (contents, props changed)
  head/lang/python34/files/patch-issue21166   (contents, props changed)

Added: head/lang/python27/files/patch-issue21166
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/python27/files/patch-issue21166	Sat Aug 23 03:53:25 2014	(r365708)
@@ -0,0 +1,74 @@
+# HG changeset patch
+# User Ned Deily <nad@acm.org>
+# Date 1408739459 25200
+# Node ID edb6b282469ea0e8f819d0310afb2937b59dd6b9
+# Parent  727fd4ead3fd854e900ed89362714ad1f7434e5a
+Issue #21166: Prevent possible segfaults and other random failures of
+python --generate-posix-vars in pybuilddir.txt build target by ensuring
+that pybuilddir.txt is always regenerated when configure is run and
+that the newly built skeleton python does not inadvertently import
+modules from previously installed instances.
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+--- Makefile.pre.in
++++ Makefile.pre.in
+@@ -447,8 +447,18 @@ platform: $(BUILDPYTHON) pybuilddir.txt
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+ # sys.path fixup -- see Modules/getpath.c.
++# Since this step runs before shared modules are built, try to avoid bootstrap
++# problems by creating a dummy pybuildstr.txt just to allow interpreter
++# initialization to succeed.  It will be overwritten by generate-posix-vars
++# or removed in case of failure.
+ pybuilddir.txt: $(BUILDPYTHON)
+-		$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars
++	@echo "none" > ./pybuilddir.txt
++	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
++	if test $$? -ne 0 ; then \
++		echo "generate-posix-vars failed" ; \
++		rm -f ./pybuilddir.txt ; \
++		exit 1 ; \
++	fi
+ 
+ # Build the shared modules
+ # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
+diff --git a/Misc/NEWS b/Misc/NEWS
+--- Misc/NEWS
++++ Misc/NEWS
+@@ -120,6 +120,9 @@ Build
+ - Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
+   now display special message when and only when there are failures.
+ 
++- Issue #21166: Prevent possible segfaults and other random failures of
++  python --generate-posix-vars in pybuilddir.txt build target.
++
+ Windows
+ -------
+ 
+diff --git a/configure b/configure
+--- configure
++++ configure
+@@ -2857,6 +2857,9 @@ case $host_os in *\ *) host_os=`echo "$h
+ 
+ 
+ 
++# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
++rm -f pybuilddir.txt
++
+ if test "$cross_compiling" = yes; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
+ $as_echo_n "checking for python interpreter for cross build... " >&6; }
+diff --git a/configure.ac b/configure.ac
+--- configure.ac
++++ configure.ac
+@@ -16,6 +16,9 @@ AC_CANONICAL_HOST
+ AC_SUBST(build)
+ AC_SUBST(host)
+ 
++# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
++rm -f pybuilddir.txt
++
+ if test "$cross_compiling" = yes; then
+     AC_MSG_CHECKING([for python interpreter for cross build])
+     if test -z "$PYTHON_FOR_BUILD"; then
+

Added: head/lang/python33/files/patch-issue21166
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/python33/files/patch-issue21166	Sat Aug 23 03:53:25 2014	(r365708)
@@ -0,0 +1,74 @@
+# HG changeset patch
+# User Ned Deily <nad@acm.org>
+# Date 1408739569 25200
+# Node ID e52d85f2e2846453dd0503613d28cf6967f113d7
+# Parent  d99014320220951707f79d114ae33f8c5a372a87
+Issue #21166: Prevent possible segfaults and other random failures of
+python --generate-posix-vars in pybuilddir.txt build target by ensuring
+that pybuilddir.txt is always regenerated when configure is run and
+that the newly built skeleton python does not inadvertently import
+modules from previously installed instances.
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+--- Makefile.pre.in
++++ Makefile.pre.in
+@@ -546,8 +546,18 @@ platform: $(BUILDPYTHON) pybuilddir.txt
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+ # sys.path fixup -- see Modules/getpath.c.
++# Since this step runs before shared modules are built, try to avoid bootstrap
++# problems by creating a dummy pybuildstr.txt just to allow interpreter
++# initialization to succeed.  It will be overwritten by generate-posix-vars
++# or removed in case of failure.
+ pybuilddir.txt: $(BUILDPYTHON)
+-	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars
++	@echo "none" > ./pybuilddir.txt
++	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
++	if test $$? -ne 0 ; then \
++		echo "generate-posix-vars failed" ; \
++		rm -f ./pybuilddir.txt ; \
++		exit 1 ; \
++	fi
+ 
+ # Build the shared modules
+ # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
+diff --git a/Misc/NEWS b/Misc/NEWS
+--- Misc/NEWS
++++ Misc/NEWS
+@@ -242,6 +242,9 @@ Build
+ 
+ - Issue #21811: Anticipated fixes to support OS X versions > 10.9.
+ 
++- Issue #21166: Prevent possible segfaults and other random failures of
++  python --generate-posix-vars in pybuilddir.txt build target.
++
+ IDLE
+ ----
+ 
+diff --git a/configure b/configure
+--- configure
++++ configure
+@@ -2950,6 +2950,9 @@ case $host_os in *\ *) host_os=`echo "$h
+ 
+ 
+ 
++# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
++rm -f pybuilddir.txt
++
+ if test "$cross_compiling" = yes; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
+ $as_echo_n "checking for python interpreter for cross build... " >&6; }
+diff --git a/configure.ac b/configure.ac
+--- configure.ac
++++ configure.ac
+@@ -53,6 +53,9 @@ AC_CANONICAL_HOST
+ AC_SUBST(build)
+ AC_SUBST(host)
+ 
++# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
++rm -f pybuilddir.txt
++
+ if test "$cross_compiling" = yes; then
+     AC_MSG_CHECKING([for python interpreter for cross build])
+     if test -z "$PYTHON_FOR_BUILD"; then
+

Added: head/lang/python34/files/patch-issue21166
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/python34/files/patch-issue21166	Sat Aug 23 03:53:25 2014	(r365708)
@@ -0,0 +1,74 @@
+# HG changeset patch
+# User Ned Deily <nad@acm.org>
+# Date 1408739569 25200
+# Node ID e52d85f2e2846453dd0503613d28cf6967f113d7
+# Parent  d99014320220951707f79d114ae33f8c5a372a87
+Issue #21166: Prevent possible segfaults and other random failures of
+python --generate-posix-vars in pybuilddir.txt build target by ensuring
+that pybuilddir.txt is always regenerated when configure is run and
+that the newly built skeleton python does not inadvertently import
+modules from previously installed instances.
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+--- Makefile.pre.in
++++ Makefile.pre.in
+@@ -546,8 +546,18 @@ platform: $(BUILDPYTHON) pybuilddir.txt
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+ # sys.path fixup -- see Modules/getpath.c.
++# Since this step runs before shared modules are built, try to avoid bootstrap
++# problems by creating a dummy pybuildstr.txt just to allow interpreter
++# initialization to succeed.  It will be overwritten by generate-posix-vars
++# or removed in case of failure.
+ pybuilddir.txt: $(BUILDPYTHON)
+-	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars
++	@echo "none" > ./pybuilddir.txt
++	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
++	if test $$? -ne 0 ; then \
++		echo "generate-posix-vars failed" ; \
++		rm -f ./pybuilddir.txt ; \
++		exit 1 ; \
++	fi
+ 
+ # Build the shared modules
+ # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
+diff --git a/Misc/NEWS b/Misc/NEWS
+--- Misc/NEWS
++++ Misc/NEWS
+@@ -242,6 +242,9 @@ Build
+ 
+ - Issue #21811: Anticipated fixes to support OS X versions > 10.9.
+ 
++- Issue #21166: Prevent possible segfaults and other random failures of
++  python --generate-posix-vars in pybuilddir.txt build target.
++
+ IDLE
+ ----
+ 
+diff --git a/configure b/configure
+--- configure
++++ configure
+@@ -2950,6 +2950,9 @@ case $host_os in *\ *) host_os=`echo "$h
+ 
+ 
+ 
++# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
++rm -f pybuilddir.txt
++
+ if test "$cross_compiling" = yes; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python interpreter for cross build" >&5
+ $as_echo_n "checking for python interpreter for cross build... " >&6; }
+diff --git a/configure.ac b/configure.ac
+--- configure.ac
++++ configure.ac
+@@ -53,6 +53,9 @@ AC_CANONICAL_HOST
+ AC_SUBST(build)
+ AC_SUBST(host)
+ 
++# pybuilddir.txt will be created by --generate-posix-vars in the Makefile
++rm -f pybuilddir.txt
++
+ if test "$cross_compiling" = yes; then
+     AC_MSG_CHECKING([for python interpreter for cross build])
+     if test -z "$PYTHON_FOR_BUILD"; then
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408230353.s7N3rPYZ052104>