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) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C013415800A for ; Thu, 20 Jul 2023 15:45:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 27891E0875; Thu, 20 Jul 2023 15:45:51 +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 E4C14E0870 for ; Thu, 20 Jul 2023 15:45:50 +0000 (UTC) Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-c84fd44593aso875964276.0 for ; Thu, 20 Jul 2023 08:45:50 -0700 (PDT) X-Gm-Message-State: ABy/qLbFCXq3uWiLQzT2VKprlH1rWEYyqA41RFvfjgHWFjl0XEZOSOcJ G/Ax4zr9RJhlf3x4vqNK8p2HQuykQgoBnZPsbTQ= X-Google-Smtp-Source: APBJJlF3SmK8N8CfS8S+CKth6IN8HdZK/JgPAToeftKx/io96b/m0JNv18DcqbKm4+YrhcUHXERwSpy6GbluDOlwRbw= X-Received: by 2002:a25:bb90:0:b0:cfe:74cf:e626 with SMTP id y16-20020a25bb90000000b00cfe74cfe626mr1539136ybg.51.1689867948224; Thu, 20 Jul 2023 08:45:48 -0700 (PDT) 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 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> In-Reply-To: <61b16cf8-9a1c-09c1-ab42-279fae0e0a4a@gentoo.org> From: Mike Gilbert Date: Thu, 20 Jul 2023 11:45:37 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-dev] [PATCH v2] meson.eclass: allow disabling verbose compilation To: gentoo-dev@lists.gentoo.org Cc: Matt Turner Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Archives-Salt: cd9ebea1-d39a-4de0-b7b0-a9b7817f5e09 X-Archives-Hash: 3f3c28f1b66ac0696a16a43d912ec05e On Thu, Jul 20, 2023 at 11:06=E2=80=AFAM Florian Schmaus = wrote: > > On 20/07/2023 17.00, Matt Turner wrote: > > On Wed, Jul 19, 2023 at 3:23=E2=80=AFAM Florian Schmaus wrote: > >> > >> On 18/07/2023 18.44, Matt Turner wrote: > >>> From: Jonas Rakebrandt > >>> > >>> This works similar to cmake.eclass's ${CMAKE_VERBOSE}. > >>> > >>> Closes: https://github.com/gentoo/gentoo/pull/28942 > >>> Signed-off-by: Jonas Rakebrandt > >>> Signed-off-by: Matt Turner > >>> --- > >>> eclass/meson.eclass | 15 +++++++++++++-- > >>> 1 file changed, 13 insertions(+), 2 deletions(-) > >>> > >>> diff --git a/eclass/meson.eclass b/eclass/meson.eclass > >>> index 2c274b213191..3b30f66bf30a 100644 > >>> --- a/eclass/meson.eclass > >>> +++ b/eclass/meson.eclass > >>> @@ -55,6 +55,12 @@ BDEPEND=3D">=3Ddev-util/meson-0.62.2 > >>> # Build directory, location where all generated files should be pl= aced. > >>> # If this isn't set, it defaults to ${WORKDIR}/${P}-build. > >>> > >>> +# @ECLASS_VARIABLE: MESON_VERBOSE > >>> +# @USER_VARIABLE > >>> +# @DESCRIPTION: > >>> +# Set to OFF to disable verbose messages during compilation > >>> +: "${MESON_VERBOSE:=3DON}" > >>> + > >>> # @ECLASS_VARIABLE: EMESON_BUILDTYPE > >>> # @DESCRIPTION: > >>> # The buildtype value to pass to meson setup. > >>> @@ -385,10 +391,15 @@ meson_src_compile() { > >>> -C "${BUILD_DIR}" > >>> --jobs "$(makeopts_jobs "${MAKEOPTS}" 0)" > >>> --load-average "$(makeopts_loadavg "${MAKEOPTS}" 0)" > >>> - --verbose > >>> - "$@" > >>> ) > >>> > >>> + case ${MESON_VERBOSE} in > >>> + OFF) ;; > >>> + *) mesoncompileargs+=3D( --verbose ) ;; > >>> + esac > >> > >> No strong opinion, just to educate myself, but is there an advantage o= f > >> using case/easc over if/fi here? > >> > >> That is > >> > >> if [[ ${MESON_VERBOSE} !=3D off ]]; then > >> mesoncompileargs+=3D( --verbose ) > >> fi > >> > >> or even the shell-style short idiom using ||. > > > > No advantage as far as I'm aware. I was just copying the style used in > > cmake.eclass. > > > > I really wish bash just had boolean types :( > > While the bash language has no boolean datatype, you can exploit the > fact that 'true' and 'false' are usually shell builtins: > > : "${MESON_VERBOSE:=3Dtrue}" > > and then later > > if $MESON_VERBOSE; then > mesoncompileargs+=3D( --verbose ) > fi 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.