scripts: use ephemeral gocache in check-each-commit
What changed, and why it matters
This change modifies a developer script so that each time it runs, it uses a temporary, throwaway Go build cache instead of the user's normal cache. It then deletes that temporary cache when the script finishes. This is a housekeeping fix to prevent the build cache from growing too large on disk over time. It does not change any code that handles money, network messages, cryptography, or user data, and it does not fix a security vulnerability.
No security action required. Treat as a normal tooling/maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch updates scripts/check-each-commit.sh to set GOCACHE to a fresh mktemp directory and register an EXIT trap to remove it. This makes the Go build cache ephemeral during the per-commit rebase/validation loop. There is no change to lnd’s runtime, build outputs, or any security-sensitive logic. The diff is purely a CI/developer-tooling quality-of-life improvement.
Changed components
scripts/check-each-commit.shInspect captured patch +9 / −0
diff --git a/scripts/check-each-commit.sh b/scripts/check-each-commit.sh
index 6ae614f..1dca8cc 100755
--- a/scripts/check-each-commit.sh
+++ b/scripts/check-each-commit.sh
@@ -12,4 +12,13 @@ if [[ "$(git log --pretty="%H %D" | grep "^[0-9a-f]*.* $1")" = "" ]]; then
echo "It seems like the current checked-out commit is not based on $1"
exit 1
fi
+
+# Keep build cache ephemeral for this run to avoid long-term disk growth.
+TMP_GOCACHE=$(mktemp -d -t lnd-check-commit-gocache.XXXXXX)
+cleanup() {
+ rm -rf "$TMP_GOCACHE"
+}
+trap cleanup EXIT
+export GOCACHE="$TMP_GOCACHE"
+
git rebase --exec scripts/check-commit.sh $1
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.