Skip to content

tools: no eviction of superseded Go-toolchain-keyed binaries in the download cache #711

Description

@wallrj

#708 keys go install-built tool binaries on the Go toolchain version:

$(DOWNLOAD_DIR)/tools/<tool>@<version>_<goversion>_<os>_<arch>

Each Go upgrade therefore produces a fresh set of binaries, and nothing evicts the superseded ones. Pruning was deliberately left out of #708: DOWNLOAD_DIR defaults to $(HOME)/.cache/makefile-modules, shared between repositories which may be on different toolchains, so unconditional pruning would thrash the cache.

But the growth is real. As @SgtCoDFish noted in review, cert-manager builds ~35 Go tools, several of them large (golangci-lint, cosign, syft, goreleaser; openapi-gen is 25MB on its own) — a full generation is on the order of 1GB+. GitHub Actions caps caches at 10GB per repository, so a few Go bumps will start evicting, and Prow's hostPath node caches have no eviction at all.

Proposal:

  • An opt-in prune-tools-cache target which removes cached tool binaries whose embedded <goversion> does not match the current GO_TOOLCHAIN_VERSION (and perhaps tool versions no longer referenced).
  • A note in the tools module README about cache growth and when to run it.

with claude fable-5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions