tailscale/version
Brad Fitzpatrick 9dfe7875fd version: show tailscale/go toolchain git hash in version output
When built with the Tailscale Go toolchain, include the toolchain's
git revision in the version output. The non-JSON output shows the
first 10 hex digits:

  go version: go1.26.2 (tailscale/go dfe2a5fd8e)

The JSON output includes the full hash as "tailscaleGoGitHash", or
omits the field when not using tsgo.

The toolchain rev is read via a separate sync.OnceValue rather than
piggybacking on getEmbeddedInfo, because that function discards all
data when VCS fields are absent (e.g. in test binaries), while the
tailscale.toolchain.rev setting is still present.

Also add a CI-only test verifying tailscaleToolchainRev is non-empty
when built with the tailscale_go build tag.

Fixes #19374

Change-Id: Ied0b16d7aead5471d8c614c30cba8b0dcf80c691
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2026-04-13 15:20:56 -07:00
..
distro all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
mkversion go.toolchain.branch: switch to Go 1.26 2026-03-04 21:57:05 -08:00
.gitignore version: greatly simplify redo nonsense, now that we use VERSION. 2020-11-02 19:54:44 -08:00
cmdname_ios.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
cmdname.go all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
cmp_test.go version: parse Void Linux version strings 2026-04-02 09:39:03 +01:00
cmp.go version: parse Void Linux version strings 2026-04-02 09:39:03 +01:00
exename.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
export_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
modinfo_test.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
print.go version: show tailscale/go toolchain git hash in version output 2026-04-13 15:20:56 -07:00
prop.go version: show tailscale/go toolchain git hash in version output 2026-04-13 15:20:56 -07:00
race_off.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
race.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
version_checkformat.go all: remove AUTHORS file and references to it 2026-01-23 15:49:45 -08:00
version_internal_test.go version: show tailscale/go toolchain git hash in version output 2026-04-13 15:20:56 -07:00
version_not_tsgo.go go.toolchain.rev, version: bump Tailscale Go, add IsTailscaleGo 2026-04-01 09:40:59 -07:00
version_test.go all: use Go 1.26 things, run most gofix modernizers 2026-03-06 13:32:03 -08:00
version_tsgo.go go.toolchain.rev, version: bump Tailscale Go, add IsTailscaleGo 2026-04-01 09:40:59 -07:00
version.go version: show tailscale/go toolchain git hash in version output 2026-04-13 15:20:56 -07:00