From nobody Fri Sep 19 07:04:31 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cSk5g2RsBz67WHG; Fri, 19 Sep 2025 07:04:39 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cSk5g1s3Vz3rNn; Fri, 19 Sep 2025 07:04:39 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758265479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yNu1lqo6BhLtgknIyO/lTJQsqL3P8Eq8pTVLPSt0BiY=; b=iUN+COZ/QK3bQc7mL4v5xgwFtz+wW96H8VtEK8SqAourpcvmn2yWHLsRAlvQgTT+Yab2ms yzeOMu74rKO6oT33F4djGVdtd36sXD7G7vAetOkprvMyKGlmCTK3G/FCsHDwDIwgu9vIBB wLjW+IqbtGuXAJw5egS5EX34pGa5rjfRgeD5c/Vu7mVgs/rj9WGB3izM5aLr0Crzfa0IqC qtAjfU5u0aGKVyds4FXRGmkN/90x0YJoL2T5z+gB8n2n+eYrOoMaH0OKVbEMUN9fl4HM9K 5+d9c8ypJmoTcegyWoiFxwil284orZkc2C1jkyH/K1hALTdxFz2u8ES4SDIzeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1758265479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yNu1lqo6BhLtgknIyO/lTJQsqL3P8Eq8pTVLPSt0BiY=; b=uYJr+h7zRvCm+eedTMt6CqP/rhCPMoBSH2rTBy8QxZZiTzLaoyg0mpaA9uL9/TR1N/oE0k e63qANnHglwcBGYYmgpzrQs8L8I1fzr8/k2khZ0Ui6Xt5N+aOYUjKHIP15yIkMZVIuLbm+ wjrYpkHwUGdWmbdjeILXTHdmXNpRvjJQeFsrMjH+3yS/E+nrWsKqlmY1DRIoYRifAou9Zt kD0RbqKZLWvUELqpBG2Du0hzgw18uevOPy7qi0OVd1eJMQmpCwPBz5iWR8HLgJ3TK2KMTz IVQnayAq7ieS5ZFEoXETrJpige7HSiAT1WNjBUSKu6b6+SoP1TbJkB+f/238mQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1758265479; a=rsa-sha256; cv=none; b=UxN0/V6/Z9hVQb/aOJR4rU4M6JSMCcIiJgPPTIb1ius9M63K+o4UupBiOR/LqbsAt776Qh /9dWU5dGrje8zjlBIf4xL1epJGBd46Gs1U9AUeDJ7tgxYUip/H5p/5lg0z0/N44SVsi7yx 8X0VUL2QXu5wW7IhVAEKbyC/0WE9I0TRoJNwXBIvNRclMnyMxkRxppGwpvlvP0U4NX9unQ pnRcGGbgcrUnzBNVRMKQiWyfKyu5nb1Tq88OHqZaitjvmlloeVk28ozPNH3O9PXSIjkZM5 1Ok5CDrYAOBgvACeQma88rBgrYpFUuvg6wCJJdKMEKCGt0463rEtyk1JRZx9xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from b.nours.eu (b.nours.eu [IPv6:2001:41d0:303:5e39::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cSk5g0WPvz16CK; Fri, 19 Sep 2025 07:04:39 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by b.nours.eu (Postfix, from userid 1001) id CA7D7B1466; Fri, 19 Sep 2025 09:04:31 +0200 (CEST) Date: Fri, 19 Sep 2025 09:04:31 +0200 From: Baptiste Daroussin To: Colin Percival Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 6b5adf33873a - main - Include a pkg package in the pkgbase repo Message-ID: References: <202509172239.58HMdOK9055924@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202509172239.58HMdOK9055924@gitrepo.freebsd.org> On Wed 17 Sep 22:39, Colin Percival wrote: > The branch main has been updated by cperciva: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6b5adf33873a309523dc4e585ff08d70bb6c6f2f > > commit 6b5adf33873a309523dc4e585ff08d70bb6c6f2f > Author: Colin Percival > AuthorDate: 2025-09-17 22:34:25 +0000 > Commit: Colin Percival > CommitDate: 2025-09-17 22:34:25 +0000 > > Include a pkg package in the pkgbase repo > > It is essential that users be able to install the FreeBSD base system > from release media and have all the bits needed to update the FreeBSD > base system without touching the ports tree or pkg.freebsd.org. To > that end, resurrect (and heavily rewrite) the make-pkg-package.sh > script and hook it into the create-packages target; if /usr/ports > exists when building pkgbase packages, we'll also (cross)build pkg > and include it in the repository. > > Scripting for actually installing this package as part of the FreeBSD > installation process to come later, but I wanted this in the tree in > time to test it in this week's snapshots. > > MFC after: 1 day > Sponsored by: https://www.patreon.com/cperciva > --- > Makefile.inc1 | 6 ++++-- > release/scripts/make-pkg-package.sh | 28 ++++++++++++---------------- > 2 files changed, 16 insertions(+), 18 deletions(-) > > diff --git a/Makefile.inc1 b/Makefile.inc1 > index 97a0b00cc517..65631c2e8eb8 100644 > --- a/Makefile.inc1 > +++ b/Makefile.inc1 > @@ -2039,12 +2039,14 @@ update-packages: .PHONY > ${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-update-packages > > package-pkg: .PHONY > +.if exists(${PORTSDIR}) > rm -rf /tmp/ports.${TARGET} || : > - env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \ > + env ${WMAKEENV} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \ > PKG_CMD=${PKG_CMD} PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} \ > WSTAGEDIR=${WSTAGEDIR} \ > OSVERSION="${SRCRELDATE}" \ > sh ${.CURDIR}/release/scripts/make-pkg-package.sh > +.endif > > real-packages: stage-packages create-packages sign-packages .PHONY > > @@ -2127,7 +2129,7 @@ create-packages-source: _pkgbootstrap _repodir .PHONY > SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH} \ > create-source-packages > > -create-packages: .PHONY create-packages-world create-packages-kernel create-packages-source create-packages-sets > +create-packages: .PHONY create-packages-world create-packages-kernel create-packages-source package-pkg create-packages-sets > > create-source-src-package: _pkgbootstrap .PHONY > rm -f ${SSTAGEDIR}/src.plist 2>/dev/null || : > diff --git a/release/scripts/make-pkg-package.sh b/release/scripts/make-pkg-package.sh > index 68172c47f326..a0ac0fc16305 100755 > --- a/release/scripts/make-pkg-package.sh > +++ b/release/scripts/make-pkg-package.sh > @@ -1,26 +1,22 @@ > #!/bin/sh > -# > -# > > -# Simulate the build environment. > -eval $(make -C ${SRCDIR} TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} buildenvvars) > +# Simulate the build environment. Note that we need to unset some variables > +# which are set in the src tree since they have different (unwanted) effects > +# in the ports tree. > +SRC_PKG_VERSION=${PKG_VERSION} > +PKG_ABI=$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI) > +unset PKG_VERSION > +unset MAKEFLAGS > +unset PKGBASE > export WRKDIRPREFIX=/tmp/ports.${TARGET} > -export WSTAGEDIR=${WSTAGEDIR} > -export REPODIR=${REPODIR} > -export PKG_CMD=${PKG_CMD} > -export PKG_VERSION=${PKG_VERSION} > -export OSVERSION=${OSVERSION} > export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR) > > make -C ${PORTSDIR}/ports-mgmt/pkg TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ I am not sure I got this properly, but You probably want to add --sysroot=${WSTAGEDIR} to ensure pkg is linked to the proper libraries and use the right headers from the target? in particular since pkg uses __FreeBSD_version in some places. > CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION}" \ Best regards, Bapt