Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH next v4 4/6] Makefile: move .NOTPARALLEL statement after including .config file
Date: Fri, 16 Nov 2018 09:53:28 +0100	[thread overview]
Message-ID: <20181116095328.283584ad@windsurf> (raw)
In-Reply-To: <20181115213758.GS10271@scaer>

Hello,

On Thu, 15 Nov 2018 22:37:58 +0100, Yann E. MORIN wrote:

> Ultimately, I don't see why we do need a config option to turn top-level
> parallel build on/off. It will ultimately be the user's choice to do so
> when calling 'make -jN' no?
> 
> However, what we do need for now, is a config option that enabled
> per-package directories (PPD, formerly known as PPS, per-package
> staging). When that is turned off, we must not allow top-level
> parallel build.
> 
> I was thinking that we would not need that option either, because we
> would enable PPD when we detect that the user is doing top-level parllel
> build, by inspecting $(MAKEFLAGS) to see if they contained -j.
> 
> However, make is our fiend here, because it does not include -j in the
> MAKFLAGS variable, but the one that is exported:
> 
>     $ cat Makefile
>     $(info var MAKEFLAGS='$(MAKEFLAGS)')
>     all:
>         @echo "env MAKEFLAGS='$${MAKEFLAGS}'"
> 
>     $ make -j1
>     var MAKEFLAGS=''
>     env MAKEFLAGS=''
> 
>     $ make -j3
>     var MAKEFLAGS=''
>     env MAKEFLAGS=' -j --jobserver-fds=3,4'
> 
>     $ make -j
>     var MAKEFLAGS=''
>     env MAKEFLAGS=' -j'
> 
> And there is no other variable in make that specifies that either...
> 
> So yes, this means we have no way from the Makefile to detect whether
> we're parallel or not. Sigh. :-(
> 
> So we do need that option for PPD.
> 
> > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>  
> 
> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Thanks for this research and the review. I think there is another
reason to have an option, at least for the moment: I'm pretty sure a
number of people not aware of top-level parallel build issues use
Buildroot with "make -jN" today, as they have learned that using make
-jN will "speed up their build" (I mean in general, not specifically
for Buildroot).

If we were to use make -jN as the criteria to decide if PPD should be
used or not, then suddenly all such users would start using PPD, which
is still way too experimental to expose it without the user's explicit
consent.

My plan is rather the following:

 (1) Have it under an explicit option for now.

 (2) Once we consider it stable, drop the option entirely, and always
     use PPD, even if the user doesn't use top-level parallel build.
     There's a slight additional cost, but there's also a huge benefit
     in terms of dependency checking/isolation.

Note that we might stay on step (1) for a little while, I think it will
take time to really make it fully usable.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-11-16  8:53 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-14 10:55 [Buildroot] [PATCH next v4 0/6] Per-package host/target directory support Thomas Petazzoni
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 1/6] Makefile: evaluate CCACHE and HOST{CC, CXX} at time of use Thomas Petazzoni
2018-11-15 20:49   ` Yann E. MORIN
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 2/6] support/scripts/check-host-rpath: split condition on two statements Thomas Petazzoni
2018-11-15 20:58   ` Yann E. MORIN
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 3/6] Makefile: rework main directory creation logic Thomas Petazzoni
2018-11-15 21:09   ` Yann E. MORIN
2018-11-16 14:08     ` Thomas Petazzoni
2018-11-16  1:21   ` Matthew Weber
2018-11-16 14:15     ` Thomas Petazzoni
2018-11-16 15:14       ` Thomas Petazzoni
2018-11-20 22:08         ` Matthew Weber
2018-11-27  6:24           ` Christian Stewart
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 4/6] Makefile: move .NOTPARALLEL statement after including .config file Thomas Petazzoni
2018-11-15 21:37   ` Yann E. MORIN
2018-11-16  8:53     ` Thomas Petazzoni [this message]
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 5/6] Makefile: define TARGET_DIR_WARNING_FILE relative to TARGET_DIR Thomas Petazzoni
2018-11-14 10:55 ` [Buildroot] [PATCH next v4 6/6] core: implement per-package SDK and target Thomas Petazzoni
2018-11-15 16:41   ` Andreas Naumann
2018-11-16 13:47     ` Thomas Petazzoni
2018-11-16 15:22       ` Thomas De Schampheleire
2018-11-16 19:57         ` Yann E. MORIN
2018-11-18 21:55           ` Arnout Vandecappelle
2018-11-19 10:48             ` Thomas Petazzoni
2018-11-19 14:27               ` Andreas Naumann
2018-11-19 19:49               ` Yann E. MORIN
2018-11-20 10:22                 ` Arnout Vandecappelle
2018-11-20 10:29                   ` Thomas Petazzoni
2018-11-20 16:18                     ` Thomas Petazzoni
2018-11-20 16:19               ` Thomas Petazzoni
2018-11-15 14:37 ` [Buildroot] [PATCH next v4 0/6] Per-package host/target directory support Thomas Petazzoni
2018-11-15 16:41 ` Andreas Naumann
2018-11-16 14:43   ` Thomas Petazzoni
2018-11-19 14:17     ` Andreas Naumann
2018-11-19 13:30 ` Arnout Vandecappelle

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=20181116095328.283584ad@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --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