git: 2c01e189ff19 - main - Reapply "release.sh: Add -jN to `make release`"

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Wed, 10 Apr 2024 03:29:23 UTC
The branch main has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=2c01e189ff190cf1618dedd01f196bca68298c44

commit 2c01e189ff190cf1618dedd01f196bca68298c44
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2024-04-10 03:27:44 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2024-04-10 03:29:16 +0000

    Reapply "release.sh: Add -jN to `make release`"
    
    With the latest changes to release/Makefile, it is now possible to
    run `make release -jN` without the build failing (at least in my
    latest tests).
    
    This reverts commit 7b707e797b2cd6265ba8f6215e59445e9efb9e97.
    
    MFC after:      1 week
---
 release/release.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/release/release.sh b/release/release.sh
index c9d0203debd4..3c68f89c2cc3 100755
--- a/release/release.sh
+++ b/release/release.sh
@@ -89,9 +89,11 @@ env_setup() {
 	SRC_CONF="/dev/null"
 
 	# The number of make(1) jobs, defaults to the number of CPUs available
-	# for buildworld, and half of number of CPUs available for buildkernel.
+	# for buildworld, and half of number of CPUs available for buildkernel
+	# and 'make release'.
 	WORLD_FLAGS="-j$(sysctl -n hw.ncpu)"
 	KERNEL_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))"
+	RELEASE_FLAGS="-j$(( $(( $(sysctl -n hw.ncpu) + 1 )) / 2))"
 
 	MAKE_FLAGS="-s"
 
@@ -190,7 +192,7 @@ env_check() {
 		${CONF_FILES}"
 	RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} \
 		KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
-	RELEASE_RMAKEFLAGS="${ARCH_FLAGS} \
+	RELEASE_RMAKEFLAGS="${ARCH_FLAGS} ${RELEASE_FLAGS} \
 		KERNCONF=\"${KERNEL}\" ${CONF_FILES} ${SRCPORTS} \
 		WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \
 		WITH_CLOUDWARE=${WITH_CLOUDWARE} XZ_THREADS=${XZ_THREADS}"