summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz93@gmail.com>2024-04-03 00:24:23 -0400
committerSam James <sam@gentoo.org>2024-04-04 02:06:39 +0100
commitdbeb507f468dcc75095d54b59c165dcc70ef558d (patch)
treef041662f7f50ca65ea614245eee2cd73984c4ae6 /eclass
parentsys-apps/systemd-utils: add workaround for no-multilib (diff)
downloadgentoo-dbeb507f468dcc75095d54b59c165dcc70ef558d.tar.gz
gentoo-dbeb507f468dcc75095d54b59c165dcc70ef558d.tar.bz2
gentoo-dbeb507f468dcc75095d54b59c165dcc70ef558d.zip
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 <eschwartz93@gmail.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/meson.eclass15
1 files 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