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 96B5F15800A for ; Thu, 20 Jul 2023 15:08:45 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 892C3E0895; Thu, 20 Jul 2023 15:08:41 +0000 (UTC) Received: from smtp.gentoo.org (mail.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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2CA62E0871 for ; Thu, 20 Jul 2023 15:08:41 +0000 (UTC) Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-6b9ad292819so749121a34.2 for ; Thu, 20 Jul 2023 08:08:40 -0700 (PDT) X-Gm-Message-State: ABy/qLar/AcqktEabnbCsAKEYidMqrsEvGZc7o8cICxRWpCkzg8aX9Ds 66SkCvmlGd0wobkKDRq4JQjFQi2yDBS3WVKxwuU= X-Google-Smtp-Source: APBJJlEVo9krqEo1MfzEf3jdNX2ow84mnKtgEuuKphyfVOpJkTRXGXFU42mm/cI47oY13GjCyWqeWj5AvKlaf6ww2F8= X-Received: by 2002:a9d:6b0f:0:b0:6b9:db92:9bd3 with SMTP id g15-20020a9d6b0f000000b006b9db929bd3mr3476203otp.13.1689865718381; Thu, 20 Jul 2023 08:08:38 -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: Matt Turner Date: Thu, 20 Jul 2023 11:08:27 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [gentoo-dev] [PATCH v2] meson.eclass: allow disabling verbose compilation To: Florian Schmaus Cc: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Archives-Salt: d310e334-41d6-4bc6-9d2f-b4eb8236f35d X-Archives-Hash: a4f3ff5229963dadd2d8cd47917a8d29 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 Oh neat, thanks for the info!