Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 270072 - net-analyzer/nfdump-1.5.8 requires MAKEOPTS="-j1" to compile
Summary: net-analyzer/nfdump-1.5.8 requires MAKEOPTS="-j1" to compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-16 15:27 UTC by garulf
Modified: 2009-07-09 15:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build log (attach,33.01 KB, text/plain)
2009-05-16 15:28 UTC, garulf
Details
emerge --info (emergeinfo,4.14 KB, text/plain)
2009-05-16 15:29 UTC, garulf
Details
Replacement patch to add dependencies on grammar.h so that parallel make does not fail (nfdump-dependency.patch,315 bytes, patch)
2009-05-17 20:21 UTC, Kevin Pyle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description garulf 2009-05-16 15:27:48 UTC
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
Comment 1 garulf 2009-05-16 15:28:27 UTC
Created attachment 191481 [details]
Build log
Comment 2 garulf 2009-05-16 15:29:02 UTC
Created attachment 191482 [details]
emerge --info
Comment 3 garulf 2009-05-16 15:29:58 UTC
(In reply to comment #0)
> When trying to compile nfdump with MAKEOPTS="-j1" fails with the following
wiht MAKEOPTS= "-j3" sorry :)
Comment 4 Kevin Pyle 2009-05-16 20:54:27 UTC
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.
Comment 5 Kevin Pyle 2009-05-17 20:20:28 UTC
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.
Comment 6 Kevin Pyle 2009-05-17 20:21:28 UTC
Created attachment 191583 [details, diff]
Replacement patch to add dependencies on grammar.h so that parallel make does not fail
Comment 7 garulf 2009-05-18 00:25:30 UTC
Using this patch instead of nfdump-1.5.8-parallel.patch works for me too :)
Comment 8 Kevin Pyle 2009-05-18 22:09:48 UTC
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.
Comment 9 garulf 2009-05-19 00:29:04 UTC
Sorry..thinked that WORKSFORME means that your patch "works for me"!
Comment 10 Andrew Savchenko gentoo-dev 2009-07-09 11:07:09 UTC
The same problem here with nfdump-1.5.8 and -j3.
Proposed patch helps, thanx.
Comment 11 Peter Volkov (RETIRED) gentoo-dev 2009-07-09 15:09:36 UTC
Thank you guys for report, fix and persistence. :)

I've updated patch in CVS with this. Fixed.