Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/3 v2] infra/pkg-golang: enforce number of parallel jobs
Date: Tue, 27 Nov 2018 18:55:31 +0100	[thread overview]
Message-ID: <20181127175531.GO28830@scaer> (raw)
In-Reply-To: <7099f806-10ab-0538-ccbc-563a792b121d@mind.be>

Arnout, All,

On 2018-11-27 18:42 +0100, Arnout Vandecappelle spake thusly:
> On 25/11/2018 10:19, Yann E. MORIN wrote:
> > By default, the go compiler will spawn as many jobs as there are CPUs
> > available, thus possibily over-shooting the limits set by the user.
> > 
> > Make it abide by the user's wish, and specify the number of jobs allowed
> > to run.
> > 
> > We can do so without fear of a package failing to build in parallel,
> > because they were already all building in parallel, as that is the
> > default for the go compiler.
> > 
> > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> > ---
> >  package/pkg-golang.mk | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
> > index 6eacd14180..4f2c7e77e1 100644
> > --- a/package/pkg-golang.mk
> > +++ b/package/pkg-golang.mk
> > @@ -55,8 +55,10 @@ ifeq ($(BR2_STATIC_LIBS),y)
> >  $(2)_LDFLAGS += -extldflags '-static'
> >  endif
> >  
> > -$(2)_BUILD_OPTS += -ldflags "$$($(2)_LDFLAGS)"
> > -$(2)_BUILD_OPTS += -tags "$$($(2)_TAGS)"
> > +$(2)_BUILD_OPTS += \
> > +	-ldflags "$$($(2)_LDFLAGS)" \
> > +	-tags "$$($(2)_TAGS)" \
> > +	-p $(PARALLEL_JOBS)
> 
>  I wonder, if BR2_LEVEL == 0, if it wouldn't be more appropriate to not pass any
> option. That said, it probably needlessly complicates things.

Well, I'd rather we be consistent: anything that want to be parallel
uses $(PARALLEL_JOBS), which is always the correct value.

>  [I also wonder but don't want to think about: what will happen in top-level
> parallel build...]

I think it would go smoothly, in fact, given the direction we're going.
AFAIR, Thomas suggested we decorelate the top-level parallelism from the
package-level parallelism, i.e. two config options: one to specify the
number of simultaneous package to build in parallel, and one to specify
the number of jobs per package [0].

That does not allow to parallelise as much as it sould be, but allows to
not overload the system too much, especially for those buildsystems that
do not know how to talk to a make-jobserver, like guess what, go, or
ninja [1] or such.

So, in the end, the existig PARALLEL_JOBS will be the package-level
paralelism, with the user specifying the top-level parallelism with
'make -j N'

Not that this is ideal, I know, but that's the best we can do...

[0] AFAIUI, that's what is done in The Other buildsystem. Or so I was
told...

[1] there is a MR pending for ninja, and they seem to be amenable to
merge it sooner or later. But there will always be outliers that don;t
know how to (or want to) play by the rules.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2018-11-27 17:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25  9:19 [Buildroot] [PATCH 0/3 v2] golang: fix build with oldish codesourcery amd64 toolchain (branch yem/go-west) Yann E. MORIN
2018-11-25  9:19 ` [Buildroot] [PATCH 1/3 v2] infra/pkg-golang: enforce number of parallel jobs Yann E. MORIN
2018-11-27 17:42   ` Arnout Vandecappelle
2018-11-27 17:55     ` Yann E. MORIN [this message]
2018-12-03 22:12   ` Peter Korsgaard
2018-11-25  9:19 ` [Buildroot] [PATCH 2/3 v2] toolchain: CodeSourcery AMD64 affected by PR20006 Yann E. MORIN
2018-12-03 22:13   ` Peter Korsgaard
2018-11-25  9:19 ` [Buildroot] [PATCH 3/3 v2] package: hide golang packages for toolchains with binutils bug 20006 Yann E. MORIN
2018-12-03 22:13   ` Peter Korsgaard
2018-11-29 20:24 ` [Buildroot] [PATCH 0/3 v2] golang: fix build with oldish codesourcery amd64 toolchain (branch yem/go-west) Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181127175531.GO28830@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox