1 This patch comes from upstream; it will likely no longer be needed whenever |
|
2 Python 3.4.2 becomes available. |
|
3 |
|
4 # HG changeset patch |
|
5 # Parent 7fafbb7e1a8fbcb8875e25d8cd07273069127556 |
|
6 Issue #21166: Prevent possible segfaults and other random failures of |
|
7 python --generate-posix-vars in pybuilddir.txt build target by ensuring |
|
8 that pybuilddir.txt is always regenerated when configure is run and |
|
9 that the newly built skeleton python does not inadvertently import |
|
10 modules from previously installed instances. |
|
11 |
|
12 --- Python-3.4.1/Makefile.pre.in Mon Aug 11 15:01:28 2014 -0500 |
|
13 +++ Python-3.4.1/Makefile.pre.in Mon Aug 11 18:16:56 2014 -0700 |
|
14 @@ -557,8 +557,18 @@ |
|
15 # Create build directory and generate the sysconfig build-time data there. |
|
16 # pybuilddir.txt contains the name of the build dir and is used for |
|
17 # sys.path fixup -- see Modules/getpath.c. |
|
18 +# Since this step runs before shared modules are built, try to avoid bootstrap |
|
19 +# problems by creating a dummy pybuildstr.txt just to allow interpreter |
|
20 +# initialization to succeed. It will be overwritten by generate-posix-vars |
|
21 +# or removed in case of failure. |
|
22 pybuilddir.txt: $(BUILDPYTHON) |
|
23 - $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars |
|
24 + @echo "none" > ./pybuilddir.txt |
|
25 + $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\ |
|
26 + if test $$? -ne 0 ; then \ |
|
27 + echo "generate-posix-vars failed" ; \ |
|
28 + rm -f ./pybuilddir.txt ; \ |
|
29 + exit 1 ; \ |
|
30 + fi |
|
31 |
|
32 # Build the shared modules |
|
33 # Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for |
|
34 --- Python-3.4.1/configure.ac Mon Aug 11 15:01:28 2014 -0500 |
|
35 +++ Python-3.4.1/configure.ac Mon Aug 11 18:16:56 2014 -0700 |
|
36 @@ -53,6 +53,9 @@ |
|
37 AC_SUBST(build) |
|
38 AC_SUBST(host) |
|
39 |
|
40 +# pybuilddir.txt will be created by --generate-posix-vars in the Makefile |
|
41 +rm -f pybuilddir.txt |
|
42 + |
|
43 if test "$cross_compiling" = yes; then |
|
44 AC_MSG_CHECKING([for python interpreter for cross build]) |
|
45 if test -z "$PYTHON_FOR_BUILD"; then |
|