From c80760883fd6d06daba96f4caf4a3cc423807479 Mon Sep 17 00:00:00 2001 From: lotherk Date: Mon, 23 Nov 2026 13:53:57 +0000 Subject: [PATCH] userland: do not check out refs/ with the submodules The reference trees are tens of gigabytes (the Linux kernel alone) and no build step reads them: srctree-stage.sh keeps them out of the source set. A fresh clone's `make release` pulled 36 GB before the timeout (measured 2026-11-23). refs/ is filtered out; the rest of the pinned submodules are checked out. --- tools/userland.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/userland.sh b/tools/userland.sh index b1874eeb9e..5ac1ba96d8 100755 --- a/tools/userland.sh +++ b/tools/userland.sh @@ -439,8 +439,14 @@ ensure_submodules() # checked out, '+' for one at the wrong commit, ' ' for the pinned one. # (The prefix is glued to the hash, so the test is on the first character # of the line, not on a field.) + # + # refs/ is left out: those are reference trees (the Linux kernel alone is + # tens of gigabytes) that tools/srctree-stage.sh keeps out of the source + # set and no build step reads. Checking them out turned a fresh clone's + # `make release` into a 36 GB download (measured 2026-11-23). need=$(cd "$TOP" && git submodule status 2>/dev/null | - awk 'substr($0, 1, 1) == "-" || substr($0, 1, 1) == "+" { print $2 }') + awk 'substr($0, 1, 1) == "-" || substr($0, 1, 1) == "+" { print $2 }' | + grep -v '^refs/') [ -n "$need" ] || return 0 echo "userland: submodules at their pin: $(echo $need)" # A submodule that cannot be fetched (a private tree this build does not