[python3/f14/master] fix parallel make (patch 112)

dmalcolm dmalcolm at fedoraproject.org
Wed Oct 13 17:25:06 UTC 2010


commit 4983daa1120c1b092495d37b724cfdf87ea0e9b2
Author: David Malcolm <dmalcolm at redhat.com>
Date:   Wed Oct 13 13:23:15 2010 -0400

    fix parallel make (patch 112)

 python-3.1.2-fix-parallel-make.patch |   37 ++++++++++++++++++++++++++++++++++
 python3.spec                         |   13 +++++++++++-
 2 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/python-3.1.2-fix-parallel-make.patch b/python-3.1.2-fix-parallel-make.patch
new file mode 100644
index 0000000..c84bce0
--- /dev/null
+++ b/python-3.1.2-fix-parallel-make.patch
@@ -0,0 +1,37 @@
+diff -up Python-3.1.2/Makefile.pre.in.fix-parallel-make Python-3.1.2/Makefile.pre.in
+--- Python-3.1.2/Makefile.pre.in.fix-parallel-make	2010-10-13 13:13:52.888849568 -0400
++++ Python-3.1.2/Makefile.pre.in	2010-10-13 13:15:10.322184015 -0400
+@@ -215,6 +215,7 @@ IO_OBJS=	\
+ 
+ ##########################################################################
+ # Grammar
++GRAMMAR_STAMP=	$(srcdir)/grammar-stamp
+ GRAMMAR_H=	$(srcdir)/Include/graminit.h
+ GRAMMAR_C=	$(srcdir)/Python/graminit.c
+ GRAMMAR_INPUT=	$(srcdir)/Grammar/Grammar
+@@ -535,9 +536,24 @@ Modules/python.o: $(srcdir)/Modules/pyth
+ 
+ $(IO_OBJS): $(IO_H)
+ 
+-$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
++# GNU "make" interprets rules with two dependents as two copies of the rule.
++#
++# In a parallel build this can lead to pgen being run twice, once for each of
++# GRAMMAR_H and GRAMMAR_C, leading to race conditions in which the compiler
++# reads a partially-overwritten copy of one of these files, leading to syntax
++# errors (or linker errors if the fragment happens to be syntactically valid C)
++#
++# See http://www.gnu.org/software/hello/manual/automake/Multiple-Outputs.html
++# for more information
++#
++# Introduce ".grammar-stamp" as a contrived single output from PGEN to avoid
++# this:
++$(GRAMMAR_H) $(GRAMMAR_C): $(GRAMMAR_STAMP)
++
++$(GRAMMAR_STAMP): $(PGEN) $(GRAMMAR_INPUT)
+ 		-@$(INSTALL) -d Include
+ 		-$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++		touch $(GRAMMAR_STAMP)
+ 
+ $(PGEN):	$(PGENOBJS)
+ 		$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
diff --git a/python3.spec b/python3.spec
index 3e0de6e..3f72f89 100644
--- a/python3.spec
+++ b/python3.spec
@@ -40,7 +40,7 @@
 Summary: Version 3 of the Python programming language aka Python 3000
 Name: python3
 Version: %{pybasever}.2
-Release: 14%{?dist}
+Release: 15%{?dist}
 License: Python
 Group: Development/Languages
 Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
@@ -229,6 +229,12 @@ Patch110: python-3.1.2-fix-expat-issue9054.patch
 # http://bugs.python.org/issue8092
 Patch111: python3-r80382-r80385-lone-surrogate-and-utf8-error-handler.patch
 
+# Fix race condition in parallel make that could lead to graminit.c failing
+# to compile, or linker errors with "undefined reference to
+# `_PyParser_Grammar'":
+# http://bugs.python.org/issue10013 and r84068
+Patch112: python-3.1.2-fix-parallel-make.patch
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: readline-devel, openssl-devel, gmp-devel
 BuildRequires: ncurses-devel, gdbm-devel, zlib-devel, expat-devel
@@ -391,6 +397,8 @@ rm -r Modules/zlib || exit 1
 
 %patch111 -p1 -b .surrogate-utf8
 
+%patch112 -p1 -b .fix-parallel-make
+
 # 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.
 #
@@ -1074,6 +1082,9 @@ rm -fr %{buildroot}
 
 
 %changelog
+* Wed Oct 13 2010 David Malcolm <dmalcolm at redhat.com> - 3.1.2-15
+- fix parallel make (patch 112)
+
 * Wed Sep  8 2010 David Malcolm <dmalcolm at redhat.com> - 3.1.2-14
 - add test.support to the core package (rhbz#596258)
 


More information about the scm-commits mailing list