Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 289264 - sys-apps/openrc does not build in parallel
Summary: sys-apps/openrc does not build in parallel
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] baselayout (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: OpenRC Team
URL: https://savannah.gnu.org/bugs/index.p...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-16 02:07 UTC by SpanKY
Modified: 2011-01-31 21:26 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SpanKY gentoo-dev 2009-10-16 02:07:37 UTC
the mk/cc.mk file seems to be causing this.  if i comment out the line:
CFLAGS+= ${_CC_FLAGS}$(shell ${_CC_FLAGS_SH})

then subdirs build in parallel just fine

simple test is to go into src/rc/ and run `make clean && make -j`.  it's obvious to tell a serial build vs a parallel build.
Comment 1 Roy Marples 2009-10-16 06:34:39 UTC
This appears to be an issue with GNU make.
FreeBSD and NetBSD make build fine in parallel.

One of my longer term goals is to remove the mk stubs I've been using and move to a home grown configure script similar to as seen in dhcpcd-5.1.x
That should solve this, but I don't have time for that right now. And no, autotools is not an option :)
Comment 2 SpanKY gentoo-dev 2009-10-16 07:14:56 UTC
while that might be true, the current build code executes gcc 17 times for every object compiled (number of flags in ${_CCFLAGS}).  that hardly sounds like a good idea.

perhaps a better idea would be to cache the results in a file and read that back if it exists.
Comment 3 SpanKY gentoo-dev 2009-10-16 07:37:47 UTC
a quicker fix might be to change the $(shell ...) to `...`

after all, the way the code is written currently, the $(shell) is expanded when the CFLAGS variable is expanded, and that gets expanded in every compile invocation

or use := to force immediate evaluation -- not like cc.mk is included when it isnt used, so you wont have "wasted" expansion
_CC_FLAGS_SH := $(shell ......)
CFLAGS += ${_CC_FLAGS}${_CC_FLAGS_SH}

if i had to guess based on some testing, make serializes $(shell) invocation so when it gets expanded by a target, all targets wait at that sync point.  maybe the internal code has a mutex so that only one thing can execute.  no idea, but i'll complain to upstream about it.
Comment 4 SpanKY gentoo-dev 2010-08-23 02:16:32 UTC
upstream maintains that current behavior in GNU make isnt going to change any time soon (if at all), so we'll need to rewrite the build system a bit
Comment 5 David J Cozatt 2010-12-03 18:18:11 UTC
This should be noted in the documentation or is a blocker to openrc going stable? When updating the scripts some scripts seem to be orphaned as well bug #347483

Suspect the majority of new installations have multiple cpu's my opinion is the docs should note this.

after reading a second time the comments I am unclear whether you mean here openrc will not build in parallel or software built on an openrc system will not build in parallel.
Comment 6 SpanKY gentoo-dev 2010-12-03 19:32:48 UTC
this bug has nothing to do with runtime execution.  like the summary says, this is about building only.
Comment 7 William Hubbs gentoo-dev 2011-01-19 22:36:10 UTC
(In reply to comment #4)
> upstream maintains that current behavior in GNU make isnt going to change any
> time soon (if at all), so we'll need to rewrite the build system a bit

Mike and all,

since we are maintaining openrc as a gentoo project now, do we want to consider converting to autotools?

If so, I will volunteer to look into doing the conversion.
Comment 8 SpanKY gentoo-dev 2011-01-20 02:45:07 UTC
i dont see the effort today being worth it
Comment 9 William Hubbs gentoo-dev 2011-01-31 20:25:44 UTC
I have added a fix in git, commit cca7e9f, which should improve this.
We now only support GNU make, so commit c2529c1 was also added to change
the README to reflect this.

If you feel comfortable testing from git, feel free to test, or, this
fix will be available in the next release.

Feel free to reopen if this reoccurs.
Comment 10 William Hubbs gentoo-dev 2011-01-31 21:26:23 UTC
Heh,

I didn't look who the reporter was when I wrote my last comment. ;-)

If you emerge from the live ebuild you will get the fix. Re-open if this is still an issue.