Skip to content

[tailscale] cmd/go: include tailscale.toolchain.rev in build cache salt#167

Merged
bradfitz merged 1 commit intotailscale.go1.26from
bradfitz/cache_key
Apr 6, 2026
Merged

[tailscale] cmd/go: include tailscale.toolchain.rev in build cache salt#167
bradfitz merged 1 commit intotailscale.go1.26from
bradfitz/cache_key

Conversation

@bradfitz
Copy link
Copy Markdown
Member

@bradfitz bradfitz commented Apr 6, 2026

The Tailscale Go fork's VERSION file matches upstream (e.g. "go1.26.1"),
so Go's build cache, keyed by runtime.Version(), doesn't invalidate when
the fork is patched without a version bump. This can cause stale
binaries to be served from cache even after a toolchain fix.

Read the tailscale.toolchain.rev build setting (already populated by CI
and Nix via sed replacement of the placeholder in runtime/debug/mod.go)
and append it to the cache hash salt. When the placeholder hasn't been
replaced (local dev builds, upstream Go), the salt is unchanged.

Updates #166
Updates tailscale/corp#36589
Updates tailscale/tailscale#19263

@bradfitz bradfitz requested a review from nickkhyl April 6, 2026 17:36
The Tailscale Go fork's VERSION file matches upstream (e.g. "go1.26.1"),
so Go's build cache, keyed by runtime.Version(), doesn't invalidate when
the fork is patched without a version bump. This can cause stale
binaries to be served from cache even after a toolchain fix.

Read the tailscale.toolchain.rev build setting (already populated by CI
and Nix via sed replacement of the placeholder in runtime/debug/mod.go)
and append it to the cache hash salt. When the placeholder hasn't been
replaced (local dev builds, upstream Go), the salt is unchanged.

Updates #166
Updates tailscale/corp#36589
Updates tailscale/tailscale#19263

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
@bradfitz bradfitz force-pushed the bradfitz/cache_key branch from a8e651e to 90ac956 Compare April 6, 2026 17:36
@bradfitz bradfitz merged commit 90ac956 into tailscale.go1.26 Apr 6, 2026
4 checks passed
@bradfitz bradfitz deleted the bradfitz/cache_key branch April 6, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants