unkin-agent d288f225ee
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
Rename GOFLAGS make variable to LDFLAGS
2026-09-26 22:22:33 +10:00

go-cache-plugin

Build repo for tailscale/go-cache-plugin, a GOCACHEPROG implementation that backs the Go build cache with S3. Upstream publishes no releases, so this repo pins a commit via the tool directive in go.mod and ships the static binary as a Gitea release.

No source of its own. To move to a newer upstream commit:

go get -tool github.com/tailscale/go-cache-plugin/cmd/go-cache-plugin@<commit>
make test

Build

make build   # dist/go-cache-plugin, CGO_ENABLED=0, stripped
make test    # builds the binary, then drives a real `go build` through it

Use

Point it at the estate's Ceph RGW, which needs both a custom endpoint and path-style addressing:

export GOCACHEPROG="go-cache-plugin \
  --cache-dir=$HOME/.cache/go-cache-plugin \
  --bucket=go-build-cache \
  --region=default \
  --s3-endpoint-url=https://s3.ceph.unkin.net \
  --s3-path-style"
go build ./...

Credentials come from the usual AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY environment. Every flag also has a GOCACHE_* environment equivalent — see go-cache-plugin help environment. Add --metrics to print cache hit rates at exit, and --expiry to age entries out.

For a shared cache daemon, run go-cache-plugin serve --plugin <port> once and have each build use go-cache-plugin connect <port> as its GOCACHEPROG.

CI

Woodpecker steps fetch the released binary:

commands:
  - curl -fsSLo /usr/local/bin/go-cache-plugin https://git.unkin.net/unkin/go-cache-plugin/releases/download/v0.1.0/go-cache-plugin-linux-amd64
  - chmod +x /usr/local/bin/go-cache-plugin

Release

make patch|minor|major tags and pushes; the tag pipeline builds linux/amd64 and linux/arm64 and attaches them with sha256sums.txt.

S
Description
Build repo that compiles the tailscale/go-cache-plugin GOCACHEPROG S3 Go build cache from a pinned upstream module version and publishes static binaries as Gitea releases.
Readme 50 KiB
v0.1.0 Latest
2026-09-27 00:35:11 +10:00
Languages
Go 66%
Makefile 27.8%
Dockerfile 6.2%