From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 41FEE15800A for ; Tue, 25 Jul 2023 08:32:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 96128E0900; Tue, 25 Jul 2023 08:32:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 62693E08F0 for ; Tue, 25 Jul 2023 08:32:22 +0000 (UTC) Message-ID: <1d6f9832c3c181cdfc8c07fdaf4c24f2f54e3b0e.camel@gentoo.org> Subject: Re: [gentoo-dev] [PATCH 1/3] multiprocessing.eclass: search also GNUMAKEFLAGS for --load-average From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Tue, 25 Jul 2023 10:32:18 +0200 In-Reply-To: References: <20230724185800.288216-1-flow@gentoo.org> <30ac5261f9bd6fc771ee4b117b7ad23fcbb6db7f.camel@gentoo.org> Organization: Gentoo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: 68de9c7b-1324-4db3-8022-9ff97be43fb9 X-Archives-Hash: 9e6affb337cbae7cb50fd1079a88510e On Tue, 2023-07-25 at 08:26 +0200, Florian Schmaus wrote: > On 25/07/2023 06.50, Micha=C5=82 G=C3=B3rny 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. > > >=20 > > > Signed-off-by: Florian Schmaus > > > --- > > > eclass/multiprocessing.eclass | 6 +++--- > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > >=20 > > > diff --git a/eclass/multiprocessing.eclass b/eclass/multiprocessing.e= class > > > 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 > > > =20 > > > # @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}) a= nd 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 numb= er, ${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=3D$(echo " $* " | sed -r -n \ > >=20 > > I'm pretty sure [GNU]MAKEFLAGS has incompatible format, in particular i= t > > makes hyphens optional. >=20 > Yes, hyphens are optional in GNUMAKEFLAGS. >=20 > However, makeopts_loadavg() would still be able to extract the=20 > hyphen-prefixed short (-l) and long (--load-average) options from=20 > GNUMAKEFLAGS. Hence having makeopts_loadavg() also inspect GNUMAKEFLAGS= =20 > seems like an improvement over the current situation. >=20 Also, shouldn't you handle MAKEFLAGS then as well? If we're to support arbitrary variables used by build systems. --=20 Best regards, Micha=C5=82 G=C3=B3rny