Skip to content

patch: cmd/go: blend in Tailscale git rev into cache keys #166

@bradfitz

Description

@bradfitz

In https://github.com/tailscale/corp/issues/36589 I had noticed that this repo doesn't blend its git hash into the build cache keys,

% GODEBUG=gocachehash=1 ./tool/go install ./misc/build/clients 2>&1 | head -20
HASH[moduleIndex]
HASH[moduleIndex]: "go1.25.6"
HASH[moduleIndex]: "modroot /Users/bradfitz/src/tailscale.io\n"
HASH[moduleIndex]: "package go1.25.6 go index v2 /Users/bradfitz/src/tailscale.io/misc/build/clients\n"
HASH[moduleIndex]: "file android.go 2026-01-28 16:05:53.813853 -0800 PST 6707\n"
HASH[moduleIndex]: "file clients_clone.go 2026-01-27 09:37:07.128569918 -0800 PST 676\n"
HASH[moduleIndex]: "file containers.go 2026-01-15 12:50:56.681144961 -0800 PST 14780\n"
HASH[moduleIndex]: "file containers_test.go 2025-10-16 07:42:52.349142573 -0700 PDT 1547\n"
HASH[moduleIndex]: "file containersandcharts.go 2025-10-16 07:42:52.349384865 -0700 PDT 2407\n"
HASH[moduleIndex]: "file corp.go 2025-10-16 07:42:52.350396031 -0700 PDT 7214\n"
HASH[moduleIndex]: "file docker-ext.go 2025-10-16 07:42:52.349863448 -0700 PDT 2364\n"
HASH[moduleIndex]: "file helmchart.go 2026-01-08 09:18:48.280624298 -0800 PST 9624\n"
HASH[moduleIndex]: "file helmchart_test.go 2025-10-16 07:42:52.350553157 -0700 PDT 4573\n"
HASH[moduleIndex]: "file multi.go 2025-10-16 07:42:52.349519615 -0700 PDT 3572\n"
HASH[moduleIndex]: "file params.go 2026-01-15 12:50:56.681272335 -0800 PST 3127\n"
HASH[moduleIndex]: "file rcpublisher.go 2025-10-16 07:42:52.350146281 -0700 PDT 2756\n"
HASH[moduleIndex]: 50863c5675eff7844ace2c89514c1fa7692ae26b9a0f6ad5ce72becf2b946c1e
HASH[moduleIndex]
HASH[moduleIndex]: "go1.25.6"
HASH[moduleIndex]

So if we cherry-pick a fix into this repo without bumping the patch number at least, caches don't get updated.

We need to carry a fix to include our runtime/debug's tailscale.toolchain.rev value into the cache keys, in src/cmd/go/internal/cache/tailscale.go

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions