aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2021-08-13 20:10:23 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2021-08-13 20:22:57 +0000
commit154492dd1f1d8c9a8f9c283f830a737c96e64a10 (patch)
tree8f4fa528164c5bb4716861deba6b165366676216 /Mk
parent497f7b9f1696a940af25c29fefe6844a53d0f2ec (diff)
downloadports-154492dd1f1d8c9a8f9c283f830a737c96e64a10.tar.gz
ports-154492dd1f1d8c9a8f9c283f830a737c96e64a10.zip
Mk/bsd.port.mk: Clarify UNAME_r failure.
An example of this happening is with recent Poudriere changes: - Poudriere <= 3.3 used to set UNAME_r in /etc/login.conf's environment during *jail creation*. - Poudriere >= 3.4 only sets it in the environment during *jail runtime*. Creating a jail with Poudriere 3.4 and then using Poudriere 3.3 on it would fail to have UNAME_r properly set. It would read OSVERSION from /usr/include/sys/param.h to find the installed files release. The ports framework, and builds, need `uname` to be correct for the *jail/chroot* and not be of the running kernel. Add a footshoot enabler while here which should not be used for any reason as it can create packages targetting the release of the running kernel rather than the chroot/jail's expected version.
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 5bdaf10cec64..390b06262018 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1195,7 +1195,11 @@ _OSVERSION_MAJOR= ${OSVERSION:C/([0-9]?[0-9])([0-9][0-9])[0-9]{3}/\1/}
# Skip if OSVERSION specified on cmdline for testing. Only works for bmake.
.if !defined(.MAKEOVERRIDES) || !${.MAKEOVERRIDES:MOSVERSION}
.if ${_OSVERSION_MAJOR} != ${_OSRELEASE:R}
-.error UNAME_r (${_OSRELEASE}) and OSVERSION (${OSVERSION}) do not agree on major version number.
+.if defined(I_DONT_CARE_IF_MY_BUILDS_TARGET_THE_WRONG_RELEASE)
+WARNING+= "I_DONT_CARE_IF_MY_BUILDS_TARGET_THE_WRONG_RELEASE set: Expect unexpected problems as the chroot/jail file versions do not match what `uname` returns. Thus buids will target the wrong release."
+.else
+.error UNAME_r (${_OSRELEASE}) and OSVERSION (${OSVERSION}) do not agree on major version number: This means your jail or chroot is misconfigured such that the installed files (OSVERION) do not match what `uname -r` (kernel) treturns. Likely setting UNAME_r will resolve the issue. OSVERSION should not be set as it will be read from /usr/include/sys/param.h.
+.endif
.elif ${_OSVERSION_MAJOR} != ${OSREL:R}
.error OSREL (${OSREL}) and OSVERSION (${OSVERSION}) do not agree on major version number.
.endif