diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-10-07 20:01:04 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-10-07 20:01:04 +0000 |
commit | b3494d0a676474320b64f2d7ca98f424e8a1ca16 (patch) | |
tree | 50250b2b0fe9e33edf8c5fa2658b358013f2e4b8 /app-shells/bash | |
parent | remove old (diff) | |
download | gentoo-2-b3494d0a676474320b64f2d7ca98f424e8a1ca16.tar.gz gentoo-2-b3494d0a676474320b64f2d7ca98f424e8a1ca16.tar.bz2 gentoo-2-b3494d0a676474320b64f2d7ca98f424e8a1ca16.zip |
Fix parallel build issues with parse.y and version.h/syntax.c.
(Portage version: 2.2.0_alpha59/cvs/Linux x86_64)
Diffstat (limited to 'app-shells/bash')
-rw-r--r-- | app-shells/bash/ChangeLog | 6 | ||||
-rw-r--r-- | app-shells/bash/bash-4.2_p10.ebuild | 3 | ||||
-rw-r--r-- | app-shells/bash/files/bash-4.2-parallel-build.patch | 68 |
3 files changed, 75 insertions, 2 deletions
diff --git a/app-shells/bash/ChangeLog b/app-shells/bash/ChangeLog index 341e66d3b211..5ba11d4b51c4 100644 --- a/app-shells/bash/ChangeLog +++ b/app-shells/bash/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for app-shells/bash # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.291 2011/09/16 17:25:35 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/ChangeLog,v 1.292 2011/10/07 20:01:04 vapier Exp $ + + 07 Oct 2011; Mike Frysinger <vapier@gentoo.org> bash-4.2_p10.ebuild, + +files/bash-4.2-parallel-build.patch: + Fix parallel build issues with parse.y and version.h/syntax.c. 16 Sep 2011; Mike Frysinger <vapier@gentoo.org> bash-4.2_p10.ebuild, +files/bash-4.2-execute-job-control.patch: diff --git a/app-shells/bash/bash-4.2_p10.ebuild b/app-shells/bash/bash-4.2_p10.ebuild index a1921e4b9134..006b9c14dfd8 100644 --- a/app-shells/bash/bash-4.2_p10.ebuild +++ b/app-shells/bash/bash-4.2_p10.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.2_p10.ebuild,v 1.4 2011/09/16 17:25:35 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-shells/bash/bash-4.2_p10.ebuild,v 1.5 2011/10/07 20:01:04 vapier Exp $ EAPI="1" @@ -73,6 +73,7 @@ src_unpack() { cd ../.. epatch "${FILESDIR}"/${PN}-4.2-execute-job-control.patch #383237 + epatch "${FILESDIR}"/${PN}-4.2-parallel-build.patch } src_compile() { diff --git a/app-shells/bash/files/bash-4.2-parallel-build.patch b/app-shells/bash/files/bash-4.2-parallel-build.patch new file mode 100644 index 000000000000..9a7f36fafbd8 --- /dev/null +++ b/app-shells/bash/files/bash-4.2-parallel-build.patch @@ -0,0 +1,68 @@ +the current yacc rules allow multiple runs to generate the same files. usually +this doesn't come up as the generated files are shipped in the tarball, but +when you modify parse.y (applying a patch or developing or whatever), you can +hit this problem. + +simple way of showing this: + make -j y.tab.{c,h} +a correct system would not show the yacc parser running twice :) + +simple patch is to have the .h file depend on the .c file, and have the .h file +itself issue a dummy rule (to avoid make thinking things changed). + +--- a/Makefile.in ++++ b/Makefile.in +@@ -579,16 +579,17 @@ + + # old rules + GRAM_H = parser-built +-y.tab.o: y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h ++y.tab.o: y.tab.h y.tab.c ${GRAM_H} command.h ${BASHINCDIR}/stdc.h input.h + ${GRAM_H}: y.tab.h + @-if test -f y.tab.h ; then \ + cmp -s $@ y.tab.h 2>/dev/null || cp -p y.tab.h $@; \ + fi +-y.tab.c y.tab.h: parse.y ++y.tab.c: parse.y + # -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi + $(YACC) -d $(srcdir)/parse.y + touch parser-built + # -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; else cp -p y.tab.h ${GRAM_H}; fi ++y.tab.h: y.tab.c ; @true + + # experimental new rules - work with GNU make but not BSD (or OSF) make + #y.tab.o: y.tab.c y.tab.h + +the current code generates a bunch of local libraries in subdirs and then +links bash against that. those subdirs sometimes need version.h. so they +have a rule to change back up to the parent dir and build version.h (which is +fine). the trouble is that the top level objects and the subdirs are allowed +to build in parallel, so it's possible for multiple children to see that +version.h is not available and that it needs to be created, so they all do. + +there is even more trouble is that version.h depends on all the top level +sources, some of which are compiled (like syntax.c). so these parallel +children all kick off a job to generate syntax.c which in turn requires the +mksyntax helper executable. obviously multiple processes rm-ing, compiling, +and linking the same files quickly falls apart. + +so tweak the subdirs to all depend on the .build target which in turn depends +on all of these top level files being generated. now the subdirs won't try and +recursively enter the top level. + +(noticed by David James) + +--- a/Makefile.in ++++ b/Makefile.in +@@ -597,6 +598,11 @@ + # $(YACC) -d $(srcdir)/parse.y + # -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi + ++# Subdirs will often times want version.h, so they'll change back up to ++# the top level and try to create it. This causes parallel build issues ++# so just force top level sanity before we descend. ++$(LIBDEP): .build ++ + $(READLINE_LIBRARY): config.h $(READLINE_SOURCE) + @echo making $@ in ${RL_LIBDIR} + @( { test "${RL_LIBDIR}" = "${libdir}" && exit 0; } || \ |