@@ 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: |