From dfd163e881192c9c0ae64d01ed14fee467adca10 Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Wed, 5 Aug 2026 12:22:11 +0300 Subject: [PATCH] ci: pin Go caches to home dirs, abuild cleans srcdir Build #256 failed in cache_save: abuild's default.conf redirects GOMODCACHE/GOCACHE into $srcdir and wipes it after packaging, so the restored caches were discarded and ~/go/pkg/mod never existed. Both defaults use ${VAR:-...}, so exporting home-dir paths via ~/.buildenv before abuild keeps the caches where cache_save expects them. --- .build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.build.yml b/.build.yml index 87df830c4b9c86214d473be65082f1c596a00297..788774b28c70c1de4ecda0c16545f6edca1bcec2 100644 --- a/.build.yml +++ b/.build.yml @@ -87,6 +87,12 @@ tasks: KEY_MOD=$(cacher key "gomod/{hash}.tar.zst" --hash-from "$REPO/go.sum") KEY_GOC=$(cacher key "gocache/{hash}.tar.zst" --hash-from "$REPO/go.sum") echo "export KEY_MOD=$KEY_MOD KEY_GOC=$KEY_GOC" >> ~/.buildenv + # abuild's default.conf points GOMODCACHE/GOCACHE into $srcdir and cleans + # it after packaging, which would discard everything we restore. Both + # defaults are ${VAR:-...}, so pre-set env wins — pin the caches to the + # stable home locations for every later task. + echo "export GOMODCACHE=$HOME/go/pkg/mod" >> ~/.buildenv + echo "export GOCACHE=$HOME/.cache/go-build" >> ~/.buildenv cacher dir download "$KEY_MOD" ~/go/pkg/mod || true cacher dir download "$KEY_GOC" ~/.cache/go-build || true - build: |