From nobody Fri Sep 20 11:39:59 2024 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 4X99RN4H2Kz5Wf3x; Fri, 20 Sep 2024 11:40:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X99RN17tFz4ldK; Fri, 20 Sep 2024 11:40:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1uhBQI7x7cGpLOlXGMOqHwioVVsdpZmNOZVKiQOjt0Y=; b=HktEz3/fAmR6vM3POKvU6vZP0G7SEhmdQNwGv/CK5Z8JVHZ/UbXR7Yv8LPRFs3Rg1QhtCy +2U9NDETE98y8kO8DbMQJEaet0ZQHdhi2cfu9fuqHK48GuGpyLdlr1ULIgi055dHzOOz9L kMvLSf5KYP1vljdWvrIx79twEYNVPGdUN8v5kxlXvU90HlUBAbNlyq5drFxCPH1A55gszk D/KOATyZd+ThZCbTo3EkK3eRNntfwz+mc1ie3i7iJedXiRiYqUGvJ3FemCyxh03DO9f6aj OvglrPgv59cL/9KzeWi35gxmIjno9J9uZ1lKL+6zOR0OCrTpM3uDDZDsD5368Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726832400; a=rsa-sha256; cv=none; b=f6GnzkmCaeU937AgEydcVZ89fnOxFStP65dnfPf6FOsJIGmNK8b9EhGxt9AhBgpAeZ2D7q XM+sMxC5kvySB6bWyfmPc0F7ULatZG0cCJUL0Fhq0mE8q7hKIgPHw4joLDxUI5GgwP9NSH 5D4VIr6UTH2jSD8fu31ZpL/epQBCOs/RiGG6nFW+/NkKmUMNKHCPY9t4sCcoFIZwNPMi1B X9EWDHaGWRJR1x8U7MJUs9IanZ4iiwfMNcbowS2cd6wrLWGwQkqvpUmWMJOz2szaH/6zkx baD763tc8hSx7HLiuldme6oAVbUIEzccllDr2UI6WTOEO890rWVup3hxnqB8VQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726832400; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1uhBQI7x7cGpLOlXGMOqHwioVVsdpZmNOZVKiQOjt0Y=; b=wpTurGYbcIN3Bg+McpS3e5Wrqsnx6m5sq8dFpGPWSU7BfXUS+F4mPUGGHFj0PKUDU9pIde WOGJ3U1oem4Nu4W7C1nBmLTX9RJCrzoKfs8TGLA+If5KW+NAZCAa3/IcLcNjQr6yq9Mlj7 xD1+/mwNJLXSXPCvdivnEWwVSqLiXSTXZoAsrh29WTi+xlG9xsqkPGgXVCsuaXfTQ/Y+/O F7rPwbnQHRhRocJcp3UBGevGyniT2R/f1QCc6E1OL7Z7K3DxYs+JUwPy6eIj1KbNd6IxNQ KEGzHyR1GxrpHJEavXbCbLhqljjSMdyoz+LrDgop7te/fCKGu4oqS9UUk1TQwA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4X99RN0R9wznj8; Fri, 20 Sep 2024 11:40:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48KBdxJF004503; Fri, 20 Sep 2024 11:39:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48KBdxfq004500; Fri, 20 Sep 2024 11:39:59 GMT (envelope-from git) Date: Fri, 20 Sep 2024 11:39:59 GMT Message-Id: <202409201139.48KBdxfq004500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: aab2c431064b - stable/14 - pkgbase: Unify pkg ABI handling for pkgbase targets 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=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: aab2c431064bbc74ae643ae111afaa23a090c594 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=aab2c431064bbc74ae643ae111afaa23a090c594 commit aab2c431064bbc74ae643ae111afaa23a090c594 Author: Mark Johnston AuthorDate: 2024-08-19 14:07:51 +0000 Commit: Mark Johnston CommitDate: 2024-09-20 11:39:16 +0000 pkgbase: Unify pkg ABI handling for pkgbase targets Right now, to get the pkg ABI we either use PKG_ABI, derived from newvers.sh, or use an ABI file from the staged world. This inconsistency is confusing and can cause problems. Switch to a single source of truth: use an ABI file from the worldstage dir to get the ABI of pkgbase packages. In particular, we do not need to know the ABI until staging is done. More specifically: - use a shell command to define PKG_ABI, - replace inline uses of ABI_FILE, - run sign-packages in a subshell (this was already done for the update-packages target) so that the staging targets are done before we try to evaluate the ABI. Reviewed by: manu MFC after: 1 month Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46287 (cherry picked from commit b118b6eb4cb7520eb348a6ac965b077fc5179fde) --- Makefile.inc1 | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 935421ea3b9a..fd35c724b965 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1970,6 +1970,10 @@ REPODIR?= ${OBJROOT}repo PKG_FORMAT?= tzst PKG_REPO_SIGNING_KEY?= # empty PKG_OUTPUT_DIR?= ${PKG_VERSION} +PKG_ABI_FILE?= ${WSTAGEDIR}/usr/bin/uname +.if make(create-*-packages*) || make(real-update-packages) || make(real-sign-packages) +PKG_ABI!= ${PKG_CMD} -o ABI_FILE=${PKG_ABI_FILE} config ABI +.endif .ORDER: stage-packages create-packages .ORDER: create-packages create-world-packages @@ -1982,12 +1986,6 @@ _pkgbootstrap: .PHONY @env ASSUME_ALWAYS_YES=YES pkg bootstrap .endif -# -# Determine PKG_ABI from newvers.sh if not already set. -# -.if !defined(PKG_ABI) && (make(create-world-packages-jobs) || make(create-kernel-packages*) || make(real-update-packages) || make (create-source-packages) || make(sign-packages)) -PKG_ABI=${_TYPE}:${MAJOR_REVISION}:${TARGET_ARCH} -.endif PKG_BIN_VERSION!=${PKG_CMD} --version /dev/null |\ awk -F. '/^[0-9.]+$$/ {print $$1 * 10000 + $$2 * 100 + $$3}' .if ${PKG_BIN_VERSION} < 11700 @@ -1997,8 +1995,7 @@ PKG_EXT= pkg .endif .if !defined(PKG_VERSION_FROM) && make(real-update-packages) -.if defined(PKG_ABI) -.if exists(${REPODIR}/${PKG_ABI}) +.if exists(${PKG_ABI_FILE}) && exists(${REPODIR}/${PKG_ABI}) PKG_VERSION_FROM!=/usr/bin/readlink ${REPODIR}/${PKG_ABI}/latest PKG_VERSION_FROM_DIR= ${REPODIR}/${PKG_ABI}/${PKG_VERSION_FROM} BRANCH_EXT_FROM= ${PKG_VERSION_FROM:C/.*([[:alpha:]][^\.]*).*/\1/} @@ -2008,7 +2005,6 @@ PKG_VERSION_FROM_DIR= BRANCH_EXT_FROM= .endif .endif -.endif PKGMAKEARGS+= PKG_VERSION=${PKG_VERSION} \ NO_INSTALLEXTRAKERNELS=${NO_INSTALLEXTRAKERNELS} @@ -2180,7 +2176,7 @@ create-world-package-${pkgname}: .PHONY @if [ "${pkgname}" == "runtime" ]; then \ sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" ${WSTAGEDIR}/${pkgname}.ucl ; \ fi - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ -o OSVERSION="${SRCRELDATE}" \ create -f ${PKG_FORMAT} -M ${WSTAGEDIR}/${pkgname}.ucl \ -p ${WSTAGEDIR}/${pkgname}.plist \ @@ -2256,7 +2252,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ -o OSVERSION="${SRCRELDATE}" \ create -f ${PKG_FORMAT} \ -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ @@ -2268,20 +2264,22 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne . endfor .endif -sign-packages: _pkgbootstrap .PHONY +sign-packages: .PHONY + ${_+_}@cd ${.CURDIR}; \ + ${MAKE} -f Makefile.inc1 PKG_VERSION=${PKG_VERSION} real-sign-packages + +real-sign-packages: _pkgbootstrap .PHONY printf "version = 2;\n" > ${WSTAGEDIR}/meta .if ${PKG_BIN_VERSION} < 11700 printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta .endif - @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \ - unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \ - -o OSVERSION="${SRCRELDATE}" \ + @[ -L "${REPODIR}/${PKG_ABI}/latest" ] && unlink ${REPODIR}/${PKG_ABI}/latest; \ + ${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \ -m ${WSTAGEDIR}/meta \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/${PKG_VERSION} \ + -o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ + ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \ ${PKG_REPO_SIGNING_KEY} ; \ - cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI); \ + cd ${REPODIR}/${PKG_ABI}; \ ln -s ${PKG_OUTPUT_DIR} latest #