Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 337831

Summary: [Tracker] Non-make Ebuilds failing with non --jobs-only MAKEOPTS
Product: Gentoo Linux Reporter: Cyprien Nicolas (fulax) <cyprien>
Component: New packagesAssignee: Gentoo Quality Assurance Team <qa>
Status: RESOLVED FIXED    
Severity: normal CC: denilsonsa, pva
Priority: High Keywords: Tracker
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://thread.gmane.org/gmane.linux.gentoo.devel/59031
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 202547, 206913, 233943, 241684, 302688, 335119, 337827    
Bug Blocks:    

Description Cyprien Nicolas (fulax) 2010-09-18 10:03:01 UTC
Hello,

I would like to revive the discussion [1] started by Diego almost two years ago, as everybody agreed on the idea, and nothing was done in that direction.
The motivation, IMHO, for that revival, comes from the bugs related to the absence of a solution for this issue

[1] http://thread.gmane.org/gmane.linux.gentoo.devel/59031

Recall of the problem:

Currently, make.conf(5) man page _suggests_ to add a --load-average option to MAKEOPTS, and dropping the documentation won't solve anything.

Some developers I talked with don't know about why this can hurt, I give a common use case:

Compiling some packages, like boost, chromium, qemu-kvm, or big Java-based things (I didn't dare to give a try to openoffice), result in a big memory consumption, then the kernel starts swapping, which result in a big system load, and the system becomes long to respond to user interaction (switching the focused window under X can take several minutes !)

Here the --load-average helps, as it prevent make from creating new process if the system-wide load is above a certain level, and thus reducing the amount of memory needing to be swapped.


MAKEOPTS, as the name suggests, is for make(1) options, which defaults to GNU Make on gnu userlands.
The parallel building is not specific to make, as a lot of other build system exists, and moving --jobs out of MAKEOPTS looks reasonable.

The discussion on gentoo-dev above (and in URL), suggests to add a JOBS make.conf variable (or GENTOO_JOBS, EJOBS, PORTAGE_JOBS...), but this would confuse the user with emerge --jobs option)

If not set, such a variable can use a default value taken from:
$ grep -c ^processor /proc/cpuinfo 

Another direction for this issue could be to add a new function in eutils.eclass to extract the --jobs from MAKEOPTS, using one unique sed expression, which will be better than all the current per-ebuild solution.

A partial list of the ebuild doing that extraction can be found using:
$ grep "echo.\+\${\?MAKEOPTS" /usr/portage/*/*/*.ebuild


As usual, the discussion here should only concern this report itself