From 751870231aff5e935ef9561f10bedf9a98f4632e Mon Sep 17 00:00:00 2001 From: ptrcnull <git@ptrcnull.me> Date: Sat, 22 Mar 2025 20:21:00 +0100 Subject: [PATCH] abuild: do not export "$srcdir" several[1][2] build systems use a variable called "srcdir" to locate either the root project directory, or some subdirectory we should not blindly export a variable under the same name, as it leads to broken builds - either loudly, when tests fail, or quietly when a ""missing"" file simply gets ignored [1]: https://github.com/PCRE2Project/pcre2/blob/pcre2-10.45/RunTest#L141 [2]: https://github.com/json-c/json-c/blob/json-c-0.18/tests/test-defs.sh#12 --- abuild.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/abuild.in b/abuild.in index bcbe5b1d..951ac91b 100644 --- a/abuild.in +++ b/abuild.in @@ -2614,7 +2614,7 @@ rootbld() { --hostname "build-$buildhost-$CARCH" \ --chdir "$startdir" \ --clearenv \ - --setenv srcdir /tmp/src \ + --setenv abuild_srcdir /tmp/src \ --setenv pkgbasedir /tmp/pkg \ --setenv tmpdir /tmp/tmp \ --setenv CARCH "$CARCH" \ @@ -2937,7 +2937,7 @@ fi APKBUILD=$(readlink -f "$APKBUILD") startdir="${APKBUILD%/*}" -srcdir=${srcdir:-"$startdir/src"} +srcdir=${srcdir:-${abuild_srcdir:-"$startdir/src"}} pkgbasedir=${pkgbasedir:-"$startdir/pkg"} tmpdir=${tmpdir:-"$startdir/tmp"} -- GitLab