From 37bb9e608c435500fe5907953946dc6749fea6b2 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Tue, 2 Jun 2026 09:13:53 +0200 Subject: [PATCH 1/3] build masterfiles tarballs in container build Add a build step to build-in-container-inner.sh that runs "make dist" and "make tar-package" on the masterfiles repo, dropping both the source and package tarballs into /output alongside the platform packages. Widen the output listing glob in build-in-container.py to *.tar.gz so the source tarball is reported too. Signed-off-by: Lars Erik Wik --- build-in-container-inner.sh | 18 ++++++++++++++++++ build-in-container.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/build-in-container-inner.sh b/build-in-container-inner.sh index 16f708477..dd7e1edae 100755 --- a/build-in-container-inner.sh +++ b/build-in-container-inner.sh @@ -88,6 +88,23 @@ install_mission_portal_deps() ( find "$BASEDIR/mission-portal" "$BASEDIR/nova/api/http" -type d -name .git -path '*/vendor/*' -exec rm -rf {} + ) +# Build the masterfiles tarballs, mirroring build-scripts/bootstrap-tarballs. +# Produces both the source tarball ("make dist") and the package tarball +# ("make tar-package", files laid out as installed under prefix) and drops +# them in /output alongside the platform packages. +build_masterfiles_tarballs() ( + set -e + + cd "$BASEDIR/masterfiles" + rm -f cfengine-masterfiles*.tar.gz + # Configure so the dist targets work, matching bootstrap-tarballs (no args). + ./configure + make dist # source tarball: cfengine-masterfiles-.tar.gz + make tar-package # package tarball: cfengine-masterfiles-.pkg.tar.gz + mv cfengine-masterfiles*.tar.gz /output/ + make distclean +) + # === Step runner with failure reporting === # Disable set -e so we can capture exit codes and report which step failed. set +e @@ -113,6 +130,7 @@ fi run_step "04-configure" "$BASEDIR/buildscripts/build-scripts/configure" run_step "05-compile" "$BASEDIR/buildscripts/build-scripts/compile" run_step "06-package" "$BASEDIR/buildscripts/build-scripts/package" +run_step "07-masterfiles-tarballs" build_masterfiles_tarballs # === Copy output packages === # Packages are created under $BASEDIR// by dpkg-buildpackage / rpmbuild. diff --git a/build-in-container.py b/build-in-container.py index adc21fe68..0e79892df 100755 --- a/build-in-container.py +++ b/build-in-container.py @@ -474,7 +474,7 @@ def main(): packages = ( list(output_dir.glob("*.deb")) + list(output_dir.glob("*.rpm")) - + list(output_dir.glob("*.pkg.tar.gz")) + + list(output_dir.glob("*.tar.gz")) ) if packages: log.info("Output packages:") From 04a0a9817dbf09057bab5238ddcb0b3b03dc2342 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Tue, 2 Jun 2026 09:35:38 +0200 Subject: [PATCH 2/3] Install php-zip in container so Composer can extract dist archives Without the zip extension Composer's --prefer-dist install fails to unpack zip archives, causing the 03-mission-portal-deps build step to error out. Signed-off-by: Lars Erik Wik --- container/Dockerfile.debian | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/container/Dockerfile.debian b/container/Dockerfile.debian index 5b2abdcf3..7b5db3cdf 100644 --- a/container/Dockerfile.debian +++ b/container/Dockerfile.debian @@ -17,9 +17,11 @@ RUN apt-get update && apt-get install -y ${NCURSES_PKGS} \ && rm -rf /var/lib/apt/lists/* # Hub build tools: Node.js 20 LTS (system nodejs is too old for modern npm -# packages that use the node: protocol), PHP, and Composer +# packages that use the node: protocol), PHP, and Composer. +# php-zip lets Composer extract --prefer-dist zip archives natively instead +# of falling back to git clones (which leave non-reproducible .git dirs). RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ - && apt-get install -y nodejs php-cli \ + && apt-get install -y nodejs php-cli php-zip \ && rm -rf /var/lib/apt/lists/* RUN npm install -g less RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer.phar From 63d54eb9a587b6721cb48cff694ee30374679798 Mon Sep 17 00:00:00 2001 From: Lars Erik Wik Date: Tue, 2 Jun 2026 10:02:40 +0200 Subject: [PATCH 3/3] Don't fail if project community and role hub Just ignore the role option for community builds. Signed-off-by: Lars Erik Wik --- build-in-container-inner.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-in-container-inner.sh b/build-in-container-inner.sh index dd7e1edae..c4f250bda 100755 --- a/build-in-container-inner.sh +++ b/build-in-container-inner.sh @@ -124,7 +124,9 @@ run_step() { # === Build steps === run_step "01-autogen" "$BASEDIR/buildscripts/build-scripts/autogen" run_step "02-install-dependencies" "$BASEDIR/buildscripts/build-scripts/install-dependencies" -if [ "$EXPLICIT_ROLE" = "hub" ]; then +# Mission Portal is an Enterprise/nova-only component; its sources are only +# synced when PROJECT=nova. Skip this step for community hubs. +if [ "$PROJECT" = "nova" ] && [ "$EXPLICIT_ROLE" = "hub" ]; then run_step "03-mission-portal-deps" install_mission_portal_deps fi run_step "04-configure" "$BASEDIR/buildscripts/build-scripts/configure"