Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 13565 - eutils.eclass get_number_of_jobs should let MAKEOPTS override
Summary: eutils.eclass get_number_of_jobs should let MAKEOPTS override
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-09 07:27 UTC by Håkan Wessberg
Modified: 2011-10-30 22:21 UTC (History)
0 users

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


Attachments
check if MAKEOPTS is from /etc/make.conf. (eutils.eclass.patch,1013 bytes, patch)
2003-01-17 05:18 UTC, Håkan Wessberg
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Håkan Wessberg 2003-01-09 07:27:58 UTC
I have a dualCPU machine, but I have MAKEOPTS="-j1" in /etc/make.conf because I
don't want heavy builds to eat all available CPU power.

I think get_number_of_jobs should not set a new MAKEOPTS if the admin already
have set MAKEOPTS in /etc/make.conf.
Comment 1 SpanKY gentoo-dev 2003-01-09 10:27:33 UTC
nall: you wrote this code, i guess its up to you if this suggestion is invalid
in terms of what you are trying to accomplish with the function
Comment 2 Jonathan Nall 2003-01-09 10:33:02 UTC
az,
this function is from the mozilla build. this is really your call.
Comment 3 Mike Stok 2003-01-09 10:53:19 UTC
while I was working on bug 13578 I noticed that this function set the number 
of jobs to 2 * the number of processors while the comment in /etc/make.conf
suggests CPUs + 1.

For a single processor CPUs * 2 == CPUs + 1, but for multiple processors
this doesn't hold.

In any case it would be good for the comment and the value calculated by 
get_number_of_jobs to agree, and my $0.02 is that if the user has a -j option 
in their MAKEOPTS we should not change it.
Comment 4 Mike Stok 2003-01-12 15:04:57 UTC
Note that in eutils.eclass the -j parameter is pulled out with a sed -e 's:-j[0-9]*::g'` - GNU make is happy to use MAKEOPTS="-j 2"

Might it be reasonable to prepend the calculated value for the -j flag to $MAKEOPTS, that way if the user has specified on GNU make will use it - the man page says:

       -j jobs
            Specifies the number of jobs (commands) to run simultaneously.  If
            there  is  more than one -j option, the last one is effective.  If
            the -j option is given without an argument, make  will  not  limit
            the number of jobs that can run simultaneously.

So if the user has set MAKEOPTS and you don't remove the
-j then

# user says
MAKEOPTS='-j 1'

# eutils.eclass thinks we can do 2 jobs, so says
# $jobs=2

export MAKEOPTS="-j{$jobs} ${MAKEOPTS}"

so make sees

MAKEOPTS="-j2 -j 1"

and uses the user's -j 1.
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-17 02:06:45 UTC
I think the point is being missed here.  Why mozilla and one or two other
builds use this, is because they fail if jobs are set too high for amount
of cpu's.  I thus *want* to override the users -j.  If you do not like it,
create a eutils.eclass with empty (or at least echo) in that function in
your portage overlay, but then do not bugreport, or at least, try whatever
with -j1 first before you do so ....
Comment 6 Håkan Wessberg 2003-01-17 05:18:16 UTC
Created attachment 7395 [details, diff]
check if MAKEOPTS is from /etc/make.conf.

From 'Gentoo Linux Developers HOWTO':
"emake runs a parallell make.
some projects cannot be made in parallell; use make"

But, I see why you want to build mozilla in as much parallellism as possible.

The thing I don't like is raising the parallellism above the level set by the
administrator.
My suggestion is to check whether MAKEOPTS is from make.globals or make.conf,
if MAKEOPTS is from make.conf, don't raise it.
Its always better not to surprise the user too much :)

Quick and dirty patch :)
A few quick tests shows expected behaviour.
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2003-01-19 14:23:41 UTC
I can live with that.  Fixed on CVS, thanks.