aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Clausecker <fuz@FreeBSD.org>2024-11-30 13:35:18 +0000
committerRobert Clausecker <fuz@FreeBSD.org>2024-12-26 10:46:28 +0000
commitdeb79782a9b87c64d06441e4bf67e46bf19c45c3 (patch)
tree32a0aa337fef45c07001e109df5d7386aa70a8ad
parentf3a65c1d6023c863ffcf8acf7c8712e05072356a (diff)
Mk/bsd.port.mk: stop ports from finding the ports tree's git repository
When building from source, the ports tree is by default a parent directory of WRKDIR. When ports try to use git to find the git commit they are built from, they'll some times find the port's git repository and produce bogus metadata. Set GIT_CEILING_DIRS in WRK_ENV to ensure that git does not escape WRK_ENV trying to look for a git repository that doesn't exist. This doesn't affect Poudriere builds as for these, WRKDIR is by default not a subdirectory of the ports tree, and neither is git installed in builder jails unless explicitly needed. As a result, bugs of this kind tend to go unnoticed by maintainers, but do affect source builders. Approved by: portmgr (mat) Exp-run by: antoine PR: 283098 Differential Revision: https://reviews.freebsd.org/D47850
-rw-r--r--Mk/bsd.port.mk3
1 files changed, 3 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 01dc08c265f5..d6a6cd4c7e25 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1615,9 +1615,12 @@ PKG_NOTES+= flavor
PKG_NOTE_flavor= ${FLAVOR}
. endif
+# GIT_CEILING_DIRECTORIES prevents ports that try to find their version
+# using git from finding the ports tree's git repository.
WRK_ENV+= HOME=${WRKDIR} \
MACHINE_ARCH=${MACHINE_ARCH} \
PWD="$${PWD}" \
+ GIT_CEILING_DIRECTORIES=${WRKDIR} \
__MAKE_CONF=${NONEXISTENT}
. for e in OSVERSION PATH TERM TMPDIR \
UNAME_b UNAME_i UNAME_K UNAME_m UNAME_n \