Bug report: Build failure with make -j24

Russ Allbery rra at stanford.edu
Sat Dec 29 21:12:17 UTC 2012


Remco Rijnders <remco at webconquest.com> writes:

> Today I tried to build the inn package for the Mageia distribution, but
> the build failed on our automated build system. See below for the
> logfiles of the automated build. I think the error is related to this
> section of the build process:

> gcc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
> -fstack-protector --param=ssp-buffer-size=4 -fstack-protector-all 
> -fomit-frame-pointer -march=i586 -mtune=generic 
> -fasynchronous-unwind-tables -DHAVE_ET_COM_ERR_H -fPIC -I../include    -c 
> -o decode.o decode.c
> mv y.tab.h config_y.h
> mv y.tab.c config_y.c
> mv y.tab.h config_y.h
> gcc -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 
> -fstack-protector --param=ssp-buffer-size=4 -fstack-protector-all 
> -fomit-frame-pointer -march=i586 -mtune=generic 
> -fasynchronous-unwind-tables -DHAVE_ET_COM_ERR_H -fPIC -I../include    -c 
> -o archive.o archive.c
> mv: cannot stat `y.tab.h': No such file or directory

> It tries to mv the same file twice, resulting in the build
> failure. After discussing this bug with some other Mageia developers, it
> seems to be caused by the %make rpm macro expanding into "make -j24" on
> the buildsystem. It built for me locally where it expands to "make -j4".
> Replacing the %make macro locally and replacing it by make -j24 also
> exhibits the same problem.

> Could this be an issue in the make scripts for inn?

Almost certainly.  Automake has a separate script (ylwrap) to handle this
sort of thing, and make rules that generate multiple files are notoriously
hard on parallelization.

There are a wide variety of complicated ways of avoiding this problem that
are detailed in the Automake manual for the general case of build rules
with multiple outputs, but the simplest fix should work in this case.
I've checked in the following patch:

--- innfeed/Makefile    (revision 9450)
+++ innfeed/Makefile    (working copy)
@@ -55,6 +55,7 @@
        $(YACC) -d $?
        mv y.tab.h config_y.h
        mv y.tab.c config_y.c
+config_y.h: config_y.c
 
 config_l.c: configfile.l
        $(LEX) $?

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list