From 183d10171fd52a897929dee6ee96b44d55576d1f Mon Sep 17 00:00:00 2001 From: lotherk Date: Mon, 23 Nov 2026 12:07:05 +0000 Subject: [PATCH] srctree-stage: a submodule that is not checked out is not fatal A fresh clone has empty directories where the submodules would be, and the source set only needs the ones the build reads (the forks of ext/ and pkgsrc). The rest -- krang, sshcrypt, kidstube, CNCL, mikronix -- are repositories whose remotes ask for a password, so 'git submodule update --recursive' aborts on them (measured 2026-11-23 on the MacBook, ext/src/mikronix) and step 5 of make release then died on 'submodule ... is not checked out'. Test: dash -n; the check is ls -A on the directory, and the root file list already drops each submodule path before pax runs. --- tools/srctree-stage.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tools/srctree-stage.sh b/tools/srctree-stage.sh index c8f3a3dab1..05caa4dc37 100755 --- a/tools/srctree-stage.sh +++ b/tools/srctree-stage.sh @@ -94,9 +94,18 @@ done (cd "$TOP" && "$PAX" -rw -pm "$DIR") < "$rootlist" \ || die "copying the repository into $DIR failed" -# Each submodule: its tracked files, no .git, no build output. +# Each submodule: its tracked files, no .git, no build output. A submodule +# that is not checked out is left out of the set: the ones the build needs are +# the forks of ext/ (ext/AGENTS.md) and pkgsrc, and the rest (krang, sshcrypt, +# kidstube, CNCL, mikronix) carry no file the release reads. A fresh clone +# that did not run `git submodule update --init' for them must not stop the +# release in this step (measured 2026-11-23: `git submodule update --recursive' +# on the MacBook aborted on ext/src/mikronix, whose remote wants a password). for sub in $SUBMODULES; do - [ -d "$TOP/$sub" ] || die "submodule $sub is not checked out" + if [ ! -d "$TOP/$sub" ] || [ -z "$(ls -A "$TOP/$sub" 2>/dev/null)" ]; then + echo "srctree-stage: $sub is not checked out, not in the source set" >&2 + continue + fi mkdir -p "$DIR/$sub" (cd "$TOP/$sub" && git ls-files) | (cd "$TOP/$sub" && "$PAX" -rw -pm "$DIR/$sub") \