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 404A515800A for ; Thu, 20 Jul 2023 17:33:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 07F65E0883; Thu, 20 Jul 2023 17:33:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BE93AE086E for ; Thu, 20 Jul 2023 17:33:44 +0000 (UTC) Date: Thu, 20 Jul 2023 13:33:40 -0400 From: Ionen Wolkens To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH v2] meson.eclass: allow disabling verbose compilation Message-ID: Mail-Followup-To: gentoo-dev@lists.gentoo.org References: <20230717145104.1404135-1-mattst88@gentoo.org> <20230718164433.1940514-1-mattst88@gentoo.org> <5abedff6-f348-d5fd-2ee4-552488491f4a@gentoo.org> <61b16cf8-9a1c-09c1-ab42-279fae0e0a4a@gentoo.org> 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 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="APCM7LLRD1ZQ/qm9" Content-Disposition: inline In-Reply-To: X-Archives-Salt: fbabe195-b20e-4a6a-a740-177d903bd7a6 X-Archives-Hash: 8222baaea65d608d22774ab23d7ddfa7 --APCM7LLRD1ZQ/qm9 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 20, 2023 at 01:11:10PM -0400, Ionen Wolkens wrote: > On Thu, Jul 20, 2023 at 06:58:04PM +0200, Ulrich Mueller wrote: > > >>>>> On Thu, 20 Jul 2023, Mike Gilbert wrote: > >=20 > > > On Thu, Jul 20, 2023 at 11:06=E2=80=AFAM Florian Schmaus wrote: > > >> While the bash language has no boolean datatype, you can exploit the > > >> fact that 'true' and 'false' are usually shell builtins: > > >>=20 > > >> : "${MESON_VERBOSE:=3Dtrue}" > > >>=20 > > >> and then later > > >>=20 > > >> if $MESON_VERBOSE; then > > >> mesoncompileargs+=3D( --verbose ) > > >> fi > >=20 > > > I think we generally try to avoid exploiting that behavior in ebuilds. > > > It's usually much more obvious to check for a non-empty string, or for > > > a specific value. > >=20 > > Testing for a non-empty variable is also faster than executing "true" > > or "false" builtins from variable values. (Which doesn't play any role > > here, but readability of the code does.) >=20 > Yes, this is what I'd recommend typically. Then documentation can say > "if set to a non-empty value" to toggle. =2E..ultimately I feel these should be e.g. MESON_NO_VERBOSE, and be default unset (same for the others build systems). Alternatively could also consider a unified SOMETHING_NO_VERBOSE variable that would be used by all eclasses / ebuild where possible or relevant. >=20 > Unfortunately this doesn't work so great when the default is enabled. > Telling people to empty it is probably weird. >=20 > wrt true/false, given MESON_VERBOSE can be set "by users" to anything > I think trying to execute that would be extra weird. >=20 > On a side-note, another way to avoid case statements is extglob which > is always enabled in [[ ]] (no need for shopt) s/another/a/, just meant this as a side-tidbit that doesn't use full on regex (unrelated) >=20 > aka: [[ ${var} =3D=3D @(first|second|third) ]] --=20 ionen --APCM7LLRD1ZQ/qm9 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmS5b/QACgkQskQGsLCs QzQbhQf/X6xlsLVim52R5J6fwWEYpf1RHe4LiaW5NP3SZcwvLU0yLclmnKsYDQMF hsN/50NEim+VupwQspq4EIFbOoqmEBdr2xtFCW8XCOUlsid1zW9dJvXXdJIuojGU 62bJqqR0/azc0hJtTT++VFmrB6eeP8lWJqLHWIyQ10zZUkyjOmTls/7MngQGg7dN PGyeGnqD5Uukvxz37gtAHiERZyBQ9MvJwpXw0cegKezzEAyF4v+2sr1CyGHBpfOU ndA/8mp8HkYJmdFEuTLE7s/G0FdBLuPA6oN/1KAzp+P6dvC8PVAQAUzNo1z36R4j MNgDI48YSRS8baogiRq03uJnFRnITg== =2hjA -----END PGP SIGNATURE----- --APCM7LLRD1ZQ/qm9--