From nobody Wed Nov 05 19:37:36 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 4d1wZm4zDSz65206; Wed, 05 Nov 2025 19:37:36 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4d1wZm30FDz3sZn; Wed, 05 Nov 2025 19:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762371456; 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=NH+7+wzypKZ90yWTL7+fJ/lNgVGJbd2bo1WY6P62THg=; b=EY2FIATA8jFcs9daQMLGGMPkWKOatIvQSKJ5FujzBGP20mjtqVQdHEPRI09ryou1udjR8/ AqqqA8sbZw4XpaEOIoydodoDfgH2DFLjWUupfsAEIjbi4p44wX9XTmfmXR+CjQ3MFJdCDn SJzRBDeqPADjDPnuk1O5oUWIA8mAjokIskPBFBlqF6rCRGZHj53i+rBRYI6Mw+CEi+G59H RrIBjX2fdnc1Cpia8XfIITnZdy01ScYnqOo+6chvwjfvzXtWlYtS5c5uTXsqHo+jm2dmmk wtchr4yiWr/LpEffbM8oko+AOuho5h4nfRcsHE7lM8VF3jtKASfaHfzwDnd08w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1762371456; 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=NH+7+wzypKZ90yWTL7+fJ/lNgVGJbd2bo1WY6P62THg=; b=Mr6vFYIE+bz8jT0e9h4PZj+UMhQvbZBLOLaJIMSGLrkj/kbfB5XEq3+Z6jEbWo4KNljNmh RdTmYvZl/Ayw9s5lSSzZmEdeWgQ/hy/tm9M59b++9oRlegAU/8HOuyheovAhEM+FfiFgas dxOkp+DaNQAAj7ALiNNXbk2fUkGB50lVYiZPt7Fr5rJ2tSxTeoyW25747i29SfP/b3G+w2 BtL7oJnL20rMtv9yqLgMWrq77v76VbFkfWCRm7vbCrbAguYYfHtTZ+LUejPqLHCrAlfzRS pNOX4loMdKeQrKXaLWq3QFVEFGry5E5ozOeBHwx9zvOUhHQU/pD5bNATDOQpVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1762371456; a=rsa-sha256; cv=none; b=jsvy7mbeBNxsSyinNT6QvoAlbpYEW5ee395KkTz0pLM8W5fd68IKrLvK+0Ooxh8lEkgBhj owwciRuf92pXtu5MfdT+I4RuFokWjVvc0hLOfk3je7zSOI5GUjSw4rEwpzWJ7Auwv+/wcQ smeIPggNad1ty4I6+4ElIiTZH/Qp4GX/MAvwofaz7+j8Kh0vbqvpHhbaHCQje0NsjCntH1 Ru34Dz9C+80INcBV0kLLsMnQb5FENc3WzJcMRj5mkWOmX818HjXUxTj8THiu8wdPml4dlx rwft1gKMThX/RX0D+s50trnyF+te+8gSxK0wKznJIUTvDoea8HOgTD2rDFZplg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4d1wZm2bFDzwwL; Wed, 05 Nov 2025 19:37:36 +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 5A5JbatR086459; Wed, 5 Nov 2025 19:37:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5A5JbaBo086456; Wed, 5 Nov 2025 19:37:36 GMT (envelope-from git) Date: Wed, 5 Nov 2025 19:37:36 GMT Message-Id: <202511051937.5A5JbaBo086456@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 2e31b9635ca1 - releng/15.0 - crypto/openssl: apply polish to new vendor import process 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: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/releng/15.0 X-Git-Reftype: branch X-Git-Commit: 2e31b9635ca18a9c57295bace041a5fd6f59bfaf Auto-Submitted: auto-generated The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=2e31b9635ca18a9c57295bace041a5fd6f59bfaf commit 2e31b9635ca18a9c57295bace041a5fd6f59bfaf Author: Enji Cooper AuthorDate: 2025-08-22 00:19:25 +0000 Commit: Colin Percival CommitDate: 2025-11-05 19:36:44 +0000 crypto/openssl: apply polish to new vendor import process This change does the following 2 things: - Makes the build more repeatable by isolating the environment. This prevents bmake from leaking variables into gmake and makes the overall process a bit more robust. - Add debug printouts to make the process more straightforward to the reader and whoever is executing doing the current vendor import. Approved by: re (cperciva) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D52420 (cherry picked from commit d18058b7b850c78f2ca1be746ab411c0bed5acc9) (cherry picked from commit 22382d9e706baddac193f66c3a48b086fc53e98c) --- crypto/openssl/BSDmakefile | 73 ++++++++++++++++++++++++++++------------------ 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/crypto/openssl/BSDmakefile b/crypto/openssl/BSDmakefile index bd2bfe0ea033..514c87ae3a8e 100644 --- a/crypto/openssl/BSDmakefile +++ b/crypto/openssl/BSDmakefile @@ -12,8 +12,10 @@ LCRYPTO_SRC= ${SRCTOP}/crypto/openssl LCRYPTO_DOC= ${LCRYPTO_SRC}/doc CAT?= /bin/cat +GMAKE?= gmake MV?= /bin/mv PERL?= perl +SETENVI= /usr/bin/env -i BN_CONF_H= include/crypto/bn_conf.h BN_CONF_H_ORIG= ${BN_CONF_H}.orig @@ -23,8 +25,11 @@ CONFIGURATION_H_ORIG= ${CONFIGURATION_H}.orig .PHONY: configure patch all .ORDER: configure patch all +LOCALBASE= /usr/local +WRK_ENV= PATH=${LOCALBASE}/bin:/bin:/usr/bin + configure: - @cd ${.CURDIR} && \ + @(cd ${.CURDIR} && ${SETENVI} \ ${PERL} ./Configure \ disable-aria \ disable-egd \ @@ -37,34 +42,45 @@ configure: enable-ktls \ enable-sctp \ --openssldir=etc \ - --prefix=/usr - @cd ${.CURDIR} && gmake configdata.pm - @cd ${LCRYPTO_SRC} && ${PERL} \ - ${LCRYPTO_SRC}/freebsd/dump_version_from_configdata.pl > \ - ${SRCTOP}/secure/lib/libcrypto/Makefile.version + --prefix=/usr) + @echo "Building configdata.pm for later use." + @(cd ${.CURDIR} && \ + ${SETENVI} ${WRK_ENV} ${GMAKE} -j ${.MAKE.JOBS} configdata.pm) -all: patch - # Passing `-j ${.MAKE.JOBS}` doesn't work here for some reason. - @cd ${.CURDIR} && gmake build_all_generated + @echo "Populating Makefile.version with release information" + @(cd ${LCRYPTO_SRC} && ${SETENVI} ${WRK_ENV} ${PERL} \ + ${LCRYPTO_SRC}/freebsd/dump_version_from_configdata.pl > \ + ${SRCTOP}/secure/lib/libcrypto/Makefile.version) - # Clean the pkgconfig files: - # 1. Fix --prefix (not sure why configure --prefix isn't honored properly). +all: patch + @echo "==> Building generated files (headers, manpages, etc)" + @(cd ${.CURDIR} && \ + ${SETENVI} ${WRK_ENV} ${GMAKE} -j ${.MAKE.JOBS} build_all_generated) + + # 1. Fix --prefix. + # a. Not sure why --prefix isn't honored properly, even though it's + # passed to Configure; the files might be getting rebuilt + # post-Configure, somehow. # 2. Remove duplicate path in CFLAGS. # 3. Remove duplicate path in includedir(s). + @echo "==> Fixing pkgconfig files" @find . -name \*.pc -print -exec sed -i '' -E \ -e 's,^prefix=.+,prefix=/usr,' \ -e 's,[[:space:]]+(\-I)?\$\{prefix\}/\./include[[:space:]]*,,g' \ {} + - @cd ${SRCTOP}/secure/lib/libcrypto && \ - ${MAKE} cleanasm && \ - ${MAKE} buildasm + @echo "==> Cleaning / rebuilding ASM" + @(cd ${SRCTOP}/secure/lib/libcrypto && \ + ${SETENVI} ${WRK_ENV} ${MAKE} cleanasm && \ + ${SETENVI} ${WRK_ENV} ${MAKE} buildasm) + @echo "==> Syncing manpages (section 1)" @rsync -a --delete \ --exclude 'Makefile*' --exclude '*.1' \ ${LCRYPTO_DOC}/man/ \ ${SRCTOP}/secure/lib/libcrypto/man + @echo "==> Syncing manpages (sections {3,5,7})" @rsync -a --delete \ --exclude 'Makefile*' --exclude '*.[357]' \ ${LCRYPTO_DOC}/man/man1/ \ @@ -75,25 +91,26 @@ all: patch # depending on the host architecture. patch: configure # Spam arch-specific overrides to config files. + @echo "==> Patching headers" + @(cd ${.CURDIR} && ${SETENVI} ${WRK_ENV} ${GMAKE} ${BN_CONF_H} && \ + ${MV} ${BN_CONF_H} ${BN_CONF_H_ORIG} && \ + ${CAT} ${BN_CONF_H}.orig \ + ${LCRYPTO_SRC}/freebsd/${BN_CONF_H} >> \ + ${BN_CONF_H}) - @cd ${.CURDIR} && gmake ${BN_CONF_H} && \ - ${MV} ${BN_CONF_H} ${BN_CONF_H_ORIG} && \ - ${CAT} ${BN_CONF_H}.orig \ - ${LCRYPTO_SRC}/freebsd/${BN_CONF_H} >> \ - ${BN_CONF_H} - - @cd ${.CURDIR} && \ - ${MV} ${CONFIGURATION_H} ${CONFIGURATION_H_ORIG} && \ - ${CAT} ${CONFIGURATION_H_ORIG} \ - ${LCRYPTO_SRC}/freebsd/${CONFIGURATION_H} >> \ - ${CONFIGURATION_H} + @(cd ${.CURDIR} && \ + ${MV} ${CONFIGURATION_H} ${CONFIGURATION_H_ORIG} && \ + ${CAT} ${CONFIGURATION_H_ORIG} \ + ${LCRYPTO_SRC}/freebsd/${CONFIGURATION_H} >> \ + ${CONFIGURATION_H}) clean: .PHONY - @cd ${.CURDIR} && rm -f ${BN_CONF_H_ORIG} ${CONFIGURATION_H_ORIG} + @(cd ${.CURDIR} && rm -f ${BN_CONF_H_ORIG} ${CONFIGURATION_H_ORIG}) - @cd ${SRCTOP}/secure/lib/libcrypto && ${MAKE} cleanasm + @(cd ${SRCTOP}/secure/lib/libcrypto && \ + ${SETENVI} ${WRK_ENV} ${MAKE} cleanasm) - -@cd ${.CURDIR} && gmake ${.TARGET} + -@(cd ${.CURDIR} && ${GMAKE} ${.TARGET}) .include