When trying to compile nfdump with MAKEOPTS="-j1" fails with the following error: i686-pc-linux-gnu-gcc -c -O2 -march=prescott -pipe nftree.c nftree.c:57:21: error: grammar.h: No such file or directory mv y.tab.c grammar.c mv y.tab.h grammar.h so i think that with -j3 y.tab.h is renamed after the compilation of nftree.c. With MAKEOPTS = "-j1" works fine. Reproducible: Always Steps to Reproduce: 1.emerge nfdump 2. 3. Actual Results: The compilation process fails. Expected Results: The compilation doesn't fail. build log attached, emerge --info attached
Created attachment 191481 [details] Build log
Created attachment 191482 [details] emerge --info
(In reply to comment #0) > When trying to compile nfdump with MAKEOPTS="-j1" fails with the following wiht MAKEOPTS= "-j3" sorry :)
Rather than forcing serial compilation, it would be better to fix the build system not to fail in parallel builds. As a first step, the Makefile should invoke flex and bison in such a way that the mv commands are not necessary. Additional dependencies may also be required to ensure that parallel make always runs flex and bison before building files that require their output. In general, it is preferable to get such changes made in the upstream repository, and then backport them into the released version via a patch applied by the ebuild. This ensures that all Linux distributions benefit, and avoids the need to maintain the fix as a Gentoo patch.
Upon closer examination, and reading the Makefile, my prior comment was incorrect. The generation under temporary names, although unnecessary with modern tools, is not wrong. The problem is that the Gentoo patch nfdump-1.5.8-parallel.patch does not add the dependencies in the correct place, so a parallel make can still skip creating the grammar until it is too late. You can observe this by configuring the package, then running "make -n -j nftree.o", which was picked since that was the target being built when garulf experienced a failure. By changing the dependencies so that nftree.o and nfreplay.o depend on grammar.h, make will build grammar.h before it tries to compile those objects. I will attach a patch to do this. This patch can be applied instead of the existing nfdump-1.5.8-parallel.patch. I replaced that patch with mine, and a parallel build with "MAKEOPTS='-j'" ran successfully.
Created attachment 191583 [details, diff] Replacement patch to add dependencies on grammar.h so that parallel make does not fail
Using this patch instead of nfdump-1.5.8-parallel.patch works for me too :)
Garulf, please reopen this bug. The resolution WORKSFORME is meant to indicate that the originally reported problem cannot be reproduced. In this case, you observed the problem, and I reproduced it. Since my patch fixes it, someone needs to commit it. Additionally, it would be good to push it upstream so that Gentoo does not need to continue maintaining it. The proper resolution for this bug is either FIXED if a Gentoo developer commits the patch, or takes some other action to ensure parallel make works without special action from the user, or WONTFIX if the developers feel that no action should be taken, which would leave parallel make broken.
Sorry..thinked that WORKSFORME means that your patch "works for me"!
The same problem here with nfdump-1.5.8 and -j3. Proposed patch helps, thanx.
Thank you guys for report, fix and persistence. :) I've updated patch in CVS with this. Fixed.