From: Florian Schmaus <flow@gentoo.org>
To: "Michał Górny" <mgorny@gentoo.org>, gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH 1/3] multiprocessing.eclass: search also GNUMAKEFLAGS for --load-average
Date: Tue, 25 Jul 2023 08:26:59 +0200 [thread overview]
Message-ID: <f23c36b0-c876-0ef8-7000-898d0bb58c8e@gentoo.org> (raw)
In-Reply-To: <30ac5261f9bd6fc771ee4b117b7ad23fcbb6db7f.camel@gentoo.org>
[-- Attachment #1.1.1: Type: text/plain, Size: 2447 bytes --]
On 25/07/2023 06.50, Michał Górny wrote:
> On Mon, 2023-07-24 at 20:57 +0200, Florian Schmaus wrote:
>> Since --load-average may not be found in other Make implementations
>> besides GNU MAKE, it is potentially found in GNUMAKEFLAGS and not in
>> MAKEOPTS.
>>
>> Signed-off-by: Florian Schmaus <flow@gentoo.org>
>> ---
>> eclass/multiprocessing.eclass | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.eclass
>> index e55be636a02c..6489ecbb44a6 100644
>> --- a/eclass/multiprocessing.eclass
>> +++ b/eclass/multiprocessing.eclass
>> @@ -1,4 +1,4 @@
>> -# Copyright 1999-2022 Gentoo Authors
>> +# Copyright 1999-2023 Gentoo Authors
>> # Distributed under the terms of the GNU General Public License v2
>>
>> # @ECLASS: multiprocessing.eclass
>> @@ -86,7 +86,7 @@ makeopts_jobs() {
>> # @FUNCTION: makeopts_loadavg
>> # @USAGE: [${MAKEOPTS}] [${inf:-999}]
>> # @DESCRIPTION:
>> -# Searches the arguments (defaults to ${MAKEOPTS}) and extracts the value set
>> +# Searches the arguments (defaults to ${MAKEOPTS} ${GNUMAKEFLAGS}) and extracts the value set
>> # for load-average. For make and ninja based builds this will mean new jobs are
>> # not only limited by the jobs-value, but also by the current load - which might
>> # get excessive due to I/O and not just due to CPU load.
>> @@ -95,7 +95,7 @@ makeopts_jobs() {
>> # If no limit is specified or --load-average is used without a number, ${inf}
>> # (defaults to 999) is returned.
>> makeopts_loadavg() {
>> - [[ $# -eq 0 ]] && set -- "${MAKEOPTS}"
>> + [[ $# -eq 0 ]] && set -- "${MAKEOPTS} ${GNUMAKEFLAGS}"
>> # This assumes the first .* will be more greedy than the second .*
>> # since POSIX doesn't specify a non-greedy match (i.e. ".*?").
>> local lavg=$(echo " $* " | sed -r -n \
>
> I'm pretty sure [GNU]MAKEFLAGS has incompatible format, in particular it
> makes hyphens optional.
Yes, hyphens are optional in GNUMAKEFLAGS.
However, makeopts_loadavg() would still be able to extract the
hyphen-prefixed short (-l) and long (--load-average) options from
GNUMAKEFLAGS. Hence having makeopts_loadavg() also inspect GNUMAKEFLAGS
seems like an improvement over the current situation.
But maybe I am missing something? I am not sure if your comment just a
remark, or do you oppose the change?
- Flow
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 17273 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 618 bytes --]
next prev parent reply other threads:[~2023-07-25 6:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 18:57 [gentoo-dev] [PATCH 1/3] multiprocessing.eclass: search also GNUMAKEFLAGS for --load-average Florian Schmaus
2023-07-24 18:57 ` [gentoo-dev] [PATCH 2/3] ninja-utils.eclass: " Florian Schmaus
2023-07-24 18:58 ` [gentoo-dev] [PATCH 3/3] meson.eclass: " Florian Schmaus
2023-07-25 4:50 ` [gentoo-dev] [PATCH 1/3] multiprocessing.eclass: " Michał Górny
2023-07-25 6:26 ` Florian Schmaus [this message]
2023-07-25 8:32 ` Michał Górny
2023-07-25 9:09 ` Florian Schmaus
2023-07-31 9:31 ` Sam James
2023-07-31 10:50 ` Florian Schmaus
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=f23c36b0-c876-0ef8-7000-898d0bb58c8e@gentoo.org \
--to=flow@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
--cc=mgorny@gentoo.org \
/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