All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: Giulio Benetti <giulio.benetti@benettiengineering.com>
Cc: Joseph Kogut <joseph.kogut@gmail.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/libnss: fix parallel build failure
Date: Tue, 19 Oct 2021 21:01:25 +0200	[thread overview]
Message-ID: <3b977617-5e9a-c874-6355-72fe81f8da38@mind.be> (raw)
In-Reply-To: <3ABFFAEE-644C-4CB8-8B04-1F28AD3CBFC1@benettiengineering.com>



On 19/10/2021 19:59, Giulio Benetti wrote:
> Or…
> 
>> Il giorno 19 ott 2021, alle ore 19:40, Giulio Benetti 
>> <giulio.benetti@benettiengineering.com> ha scritto:
>>
>> Hi Arnout,
>>
>>> Il giorno 6 ott 2021, alle ore 21:20, Arnout Vandecappelle <arnout@mind.be> 
>>> ha scritto:
>>>
>>> 
>>>
>>> On 22/09/2021 01:59, Giulio Benetti wrote:

[snip]
>>>> ++.NOTPARALLEL: $(1)
>>>
>>> This doesn't make a whole lot of sense: .NOTPARALLEL is something that 
>>> applies to the Makefile as a whole, not to one specific target. I haven't 
>>> looked in any depth in the libnss build system, but unless it builds 
>>> recursively, adding this is exactly equivalent to adding
>>>
>>> .NOTPARALLEL:
>>
>> As I’ve tested it’s not like this.
>>
>> I read this from [1]:
>> ‘’’
>> |.NOTPARALLEL|
>>
>>     If |.NOTPARALLEL| is mentioned as a target, then this invocation of
>>     |make| will be run serially, even if the ‘-j’ option is given. Any
>>     recursively invoked |make| command will still run recipes in parallel
>>     (unless its makefile also contains this target). Any prerequisites on this
>>     target are ignored.
>>
>> ‘’’
>>
>> They talk about target and it is what I experience.
>> It’s a bit ambiguous honestly. 

"target" is the thing on the left-hand side of a colon. So in

.NOTPARALLEL: %.bmp

the target is .NOTPARALLEL. My point is that the thing on the right-hand side of 
the colon is ignored. It makes no difference at all if you put %.bmp there, or 
blablabla - when you use that Makefile, the -j option will be ignored.

So what you're doing is that you make the whole thing not run in parallel, not 
just the build of whatever you put on the right-hand side.


>> In the past I’ve also
>> experienced it on a big Makefile where I had .bmp files to be converted with 
>> xxd and that gave parallel problems. So I’ve tagged it like:
>>
>> .NOTPARALLEL: %.bmp
>>
>> and that solved the problem.
> 
> …it is because in both cases they are called recursively.

  Because it is called recursively, the higher-level make invocations are indeed 
still run in parallel.

  Therefore, indeed, it does make sense to put it inside the macro.

  But it doesn't make sense to add a right-hand side.

  Anyway, since it's been applied upstream, we can just ignore the issue.

  Regards,
  Arnout


> 
> Giulio
> 
>>
>> Also they have just upstreamed the patch [2], so
>> we can test if it works committing this patch or
>> by bumping next version.
>>
>> Then it’s up to you :-)
>>
>> Best regards
>> Giulio Benetti
>> Benetti Engineering sas
>>
>> [1]: https://www.gnu.org/software/make/manual/html_node/Special-Targets.html 
>> <https://www.gnu.org/software/make/manual/html_node/Special-Targets.html>
>> [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1731911 
>> <https://bugzilla.mozilla.org/show_bug.cgi?id=1731911>
>>
>>>
>>> anywhere in the Makefiles. This is BTW what we do in Buildroot.
>>>
>>> And in the end, that's the same as calling $(MAKE1) from Buildroot, so 
>>> patching is not really needed.
>>>
>>> If you want to be a little smarter, you will have to manually "unroll" the 
>>> dependency, like:
>>>
>>> $(1): | $(3)/d
>>>    $$(foreach tgt,$(2),$(MAKE) $(3)/$$($(tgt)))
>>>
>>> (chances are I made some major mistake in this thing).
>>>
>>> Or if it does build recursively, you can probably conditionally add 
>>> .NOTPARALLEL in some smart way.
>>>
>>> Anyway, I've marked this patch as Changed Requested.
>>>
>>> Regards,
>>> Arnout
>>>
>>>
>>>> + endif
>>>> + else
>>>> + $(1):
>>>> +--
>>>> +2.25.1
>>>> +
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2021-10-19 19:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21 23:59 [Buildroot] [PATCH 0/1] Fix libnss parallel build failure Giulio Benetti
2021-09-21 23:59 ` [Buildroot] [PATCH 1/1] package/libnss: fix " Giulio Benetti
2021-10-06 19:20   ` Arnout Vandecappelle
2021-10-19 17:33     ` Giulio Benetti
2021-10-19 17:59       ` Giulio Benetti
2021-10-19 19:01         ` Arnout Vandecappelle [this message]
2021-10-19 19:38           ` Giulio Benetti
2021-09-23 16:50 ` [Buildroot] [PATCH 0/1] Fix libnss " Giulio Benetti
2021-10-04 23:22   ` Giulio Benetti

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=3b977617-5e9a-c874-6355-72fe81f8da38@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@buildroot.org \
    --cc=giulio.benetti@benettiengineering.com \
    --cc=joseph.kogut@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.