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 A2CA3158043 for ; Tue, 16 Apr 2024 21:13:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E4CEAE29F6; Tue, 16 Apr 2024 21:13:23 +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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9C474E29F3 for ; Tue, 16 Apr 2024 21:13:23 +0000 (UTC) From: Mike Gilbert To: gentoo-dev@lists.gentoo.org Cc: Mike Gilbert Subject: [gentoo-dev] [PATCH] meson.eclass: preserve exit status in phase funcs Date: Tue, 16 Apr 2024 17:13:19 -0400 Message-ID: <20240416211319.1498820-1-floppym@gentoo.org> X-Mailer: git-send-email 2.44.0 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-Transfer-Encoding: 8bit X-Archives-Salt: f84af1fe-30aa-48e6-840b-e7cc8f70289f X-Archives-Hash: 6c52ee642eadf7809fc75ee6bfe34c0c When the functions are called with nonfatal, we need to ensure 'popd' does not clobber the exit status of the called command. Update meson_src_configure as well just for consistency. Closes: https://bugs.gentoo.org/930119 Signed-off-by: Mike Gilbert --- eclass/meson.eclass | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/eclass/meson.eclass b/eclass/meson.eclass index 9d7f830e58b0..a22a85887584 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -425,7 +425,10 @@ meson_src_configure() { export -n {C,CPP,CXX,F,OBJC,OBJCXX,LD}FLAGS PKG_CONFIG_{LIBDIR,PATH} echo meson setup "${MESONARGS[@]}" >&2 meson setup "${MESONARGS[@]}" - ) || die -n + ) + local rv=$? + [[ ${rv} -eq 0 ]] || die -n "configure failed" + return ${rv} } # @FUNCTION: meson_src_compile @@ -451,9 +454,12 @@ meson_src_compile() { set -- meson compile "${mesoncompileargs[@]}" echo "$@" >&2 - "$@" || die -n "compile failed" + "$@" + local rv=$? + [[ ${rv} -eq 0 ]] || die -n "compile failed" popd > /dev/null || die + return ${rv} } # @FUNCTION: meson_src_test @@ -473,9 +479,12 @@ meson_src_test() { set -- meson test "${mesontestargs[@]}" echo "$@" >&2 - "$@" || die -n "tests failed" + "$@" + local rv=$? + [[ ${rv} -eq 0 ]] || die -n "tests failed" popd > /dev/null || die + return ${rv} } # @FUNCTION: meson_install @@ -495,9 +504,12 @@ meson_install() { set -- meson install "${mesoninstallargs[@]}" echo "$@" >&2 - "$@" || die -n "install failed" + "$@" + local rv=$? + [[ ${rv} -eq 0 ]] || die -n "install failed" popd > /dev/null || die + return ${rv} } # @FUNCTION: meson_src_install -- 2.44.0