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 BE9B9158041 for ; Thu, 4 Apr 2024 01:07:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 684B6E2A30; Thu, 4 Apr 2024 01:07: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 249AFE2A30 for ; Thu, 4 Apr 2024 01:07:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 smtp.gentoo.org (Postfix) with ESMTPS id 3A4C43431AA for ; Thu, 4 Apr 2024 01:07:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 50C301671 for ; Thu, 4 Apr 2024 01:07:41 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1712192799.dbeb507f468dcc75095d54b59c165dcc70ef558d.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/meson.eclass X-VCS-Directories: eclass/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: dbeb507f468dcc75095d54b59c165dcc70ef558d X-VCS-Branch: master Date: Thu, 4 Apr 2024 01:07:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 983f1171-1398-4b60-b981-5c1865064293 X-Archives-Hash: 1e5389875f2928b499d11bc3d45f1ab7 commit: dbeb507f468dcc75095d54b59c165dcc70ef558d Author: Eli Schwartz gmail com> AuthorDate: Wed Apr 3 04:24:23 2024 +0000 Commit: Sam James gentoo org> CommitDate: Thu Apr 4 01:06:39 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbeb507f meson.eclass: set working directory to BUILD_DIR In phases where the build directory has been configured and we are operating on it, it is better to change directories instead of passing -C options. This allows portage to know where we are, and in the case of errors it will then print: * Working directory: '/var/tmp/portage/www-client/elinks-0.16.1.1-r2/work/elinks-0.16.1.1-build' * S: '/var/tmp/portage/www-client/elinks-0.16.1.1-r2/work/elinks-0.16.1.1' instead of simply listing both as the same directory. This is much more convenient to copy/paste for the sake of entering the failed build and examining it. Signed-off-by: Eli Schwartz gmail.com> Signed-off-by: Sam James gentoo.org> eclass/meson.eclass | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/eclass/meson.eclass b/eclass/meson.eclass index 3074fcb09fb0..9d7f830e58b0 100644 --- a/eclass/meson.eclass +++ b/eclass/meson.eclass @@ -435,8 +435,9 @@ meson_src_configure() { meson_src_compile() { debug-print-function ${FUNCNAME} "$@" + pushd "${BUILD_DIR}" > /dev/null || die + local mesoncompileargs=( - -C "${BUILD_DIR}" --jobs "$(get_makeopts_jobs 0)" --load-average "$(get_makeopts_loadavg 0)" ) @@ -451,6 +452,8 @@ meson_src_compile() { set -- meson compile "${mesoncompileargs[@]}" echo "$@" >&2 "$@" || die -n "compile failed" + + popd > /dev/null || die } # @FUNCTION: meson_src_test @@ -460,9 +463,10 @@ meson_src_compile() { meson_src_test() { debug-print-function ${FUNCNAME} "$@" + pushd "${BUILD_DIR}" > /dev/null || die + local mesontestargs=( --print-errorlogs - -C "${BUILD_DIR}" --num-processes "$(makeopts_jobs "${MAKEOPTS}")" "$@" ) @@ -470,6 +474,8 @@ meson_src_test() { set -- meson test "${mesontestargs[@]}" echo "$@" >&2 "$@" || die -n "tests failed" + + popd > /dev/null || die } # @FUNCTION: meson_install @@ -479,8 +485,9 @@ meson_src_test() { meson_install() { debug-print-function ${FUNCNAME} "$@" + pushd "${BUILD_DIR}" > /dev/null || die + local mesoninstallargs=( - -C "${BUILD_DIR}" --destdir "${D}" --no-rebuild "$@" @@ -489,6 +496,8 @@ meson_install() { set -- meson install "${mesoninstallargs[@]}" echo "$@" >&2 "$@" || die -n "install failed" + + popd > /dev/null || die } # @FUNCTION: meson_src_install