Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Setting number of parallel builds for other build-systems than 'make'
Date: Sun, 01 Oct 2006 19:33:17
Message-Id: 20061001192713.GA7046@seldon
In Reply to: Re: [gentoo-dev] Setting number of parallel builds for other build-systems than 'make' by Donnie Berkholz
1 On Sun, Oct 01, 2006 at 09:52:14AM -0700, Donnie Berkholz wrote:
2 > Tiziano Müller wrote:
3 > >-----BEGIN PGP SIGNED MESSAGE-----
4 > >Hash: SHA1
5 > >
6 > >Hi everyone
7 > >
8 > >It seems that setting the number of parallel builds using '-jN' does not
9 > >only work for make, but also for scons and bjam (and maybe others as well).
10 > >Since it isn't save to assume that '-jN' is the only option in MAKEOPTS,
11 > >some filtering is needed.
12 > >Now, SCONSOPTS (BJAMOPTS respectively) could be added to make.conf and used
13 > >whenever one of those build-systems is being used. But we would probably
14 > >have to add a ...OPTS for every build-system.
15 > >
16 > >What do you think? Better ideas?
17 >
18 > I think adding it for each build system is probably a good idea,
19 > nobody's guaranteeing option-level compatibility with make. Optionally
20 > falling back to using the few valid MAKEOPTS might be a nice addition.
21
22 I might be daft (likely), but why not just introduce a var indicating
23 max parallelization instead? Tweak portage to push that setting into
24 MAKEOPTS="${MAKEOPTS+${MAKEOPTS} } -j${PARALLELIZATION}".
25
26 Might sound daft, but -j is hardcoded parallelization; if you're
27 trying to run 3 build processes, the original var of -j isn't all that
28 useful, nor will the hardcoded -j# var set for 3 package build
29 processes be useful if you're doing a single build.
30
31 Depending on number of seperate package build processes possible, the
32 # of build processes allocated per build process needs to vary
33 (essentially).
34
35 Now... that's a bit ahead of what portage is doing atm, but folks
36 *will* parallelize portage building (see bug 147516 if in doubt), so
37 its not too far out.
38
39 Getting back to the actual topic, set this var, it's a raw int that a
40 scons/bjam eclass can use to easily set appropriate var with the
41 parallelization requested, thus unifying this particular knob; more
42 importantly, it gives them a way to do what they're after while
43 exposing a knob that the pkg manager can easily fiddle with for global
44 parallelization needs.
45
46 Only downside to it I see is that it requires mangling the pkg manager
47 to translate the parallelization setting into MAKEOPTS+=-j#; can't
48 really get around that however due to the fact MAKEOPTS is already
49 forced in installed configuration though.
50
51 Thoughts?
52 ~harring

Replies