Skip to content

Commit

Permalink
pkgbase: Let source packages be built in parallel
Browse files Browse the repository at this point in the history
To build the packages target, we build src and src-sys packages
containing the source code from which the repo was built.  These
packages take significantly longer than the others, presumably because
they contain many more files.  Because both source packages are built
to satisfy the same target, they end up being built serially.  Split
them into separate subtargets so that they can run in parallel.  This
saves a couple of minutes on my build machine.

Reviewed by:	manu, emaste
MFC after:	1 month
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D46288
  • Loading branch information
markjdb committed Aug 19, 2024
1 parent b118b6e commit d7d5c9e
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions Makefile.inc1
Original file line number Diff line number Diff line change
Expand Up @@ -2119,17 +2119,13 @@ create-packages-source: _pkgbootstrap _repodir .PHONY

create-packages: .PHONY create-packages-world create-packages-kernel create-packages-source

create-source-packages: _pkgbootstrap .PHONY
create-source-src-package: _pkgbootstrap .PHONY
rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || :
.if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git)
@cd ${SRCDIR}; \
( echo "@override_prefix /usr/src" ; \
${GIT_CMD} ls-files --recurse-submodules ":!:sys/" ) \
> ${SSTAGEDIR}/src.plist
@cd ${SRCDIR}; \
( echo "@override_prefix /usr/src" ; \
${GIT_CMD} ls-files --recurse-submodules "sys/" ) \
> ${SSTAGEDIR}/src-sys.plist
${SRCDIR}/release/packages/generate-ucl.lua \
PKGNAME "src" \
PKGGENNAME "src" \
Expand All @@ -2141,6 +2137,22 @@ create-source-packages: _pkgbootstrap .PHONY
PKG_WWW "${PKG_WWW}" \
${SRCDIR}/release/packages/template.ucl \
${SSTAGEDIR}/src.ucl
${PKG_CMD} -o ABI=${PKG_ABI} \
-o OSVERSION="${SRCRELDATE}" \
create -f ${PKG_FORMAT} \
-M ${SSTAGEDIR}/src.ucl \
-p ${SSTAGEDIR}/src.plist \
-r ${SRCDIR} \
-o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
.endif

create-source-src-sys-package: _pkgbootstrap .PHONY
rm -f ${SSTAGEDIR}/*.plist 2>/dev/null || :
.if !empty(GIT_CMD) && exists(${GIT_CMD}) && exists(${SRCDIR}/.git)
@cd ${SRCDIR}; \
( echo "@override_prefix /usr/src" ; \
${GIT_CMD} ls-files --recurse-submodules "sys/" ) \
> ${SSTAGEDIR}/src-sys.plist
${SRCDIR}/release/packages/generate-ucl.lua \
PKGNAME "src-sys" \
PKGGENNAME "src" \
Expand All @@ -2152,13 +2164,6 @@ create-source-packages: _pkgbootstrap .PHONY
PKG_WWW "${PKG_WWW}" \
${SRCDIR}/release/packages/template.ucl \
${SSTAGEDIR}/src-sys.ucl
${PKG_CMD} -o ABI=${PKG_ABI} \
-o OSVERSION="${SRCRELDATE}" \
create -f ${PKG_FORMAT} \
-M ${SSTAGEDIR}/src.ucl \
-p ${SSTAGEDIR}/src.plist \
-r ${SRCDIR} \
-o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
${PKG_CMD} -o ABI=${PKG_ABI} \
-o OSVERSION="${SRCRELDATE}" \
create -f ${PKG_FORMAT} \
Expand All @@ -2168,6 +2173,8 @@ create-source-packages: _pkgbootstrap .PHONY
-o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
.endif

create-source-packages: .PHONY _pkgbootstrap create-source-src-package create-source-src-sys-package

create-world-packages: _pkgbootstrap .PHONY
@rm -f ${WSTAGEDIR}/*.plist 2>/dev/null || :
@cd ${WSTAGEDIR} ; \
Expand Down

0 comments on commit d7d5c9e

Please sign in to comment.