mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 16:11:23 +00:00
tailscaleroot: panic if tailscale_go build tag but Go toolchain mismatch
Fixes #13527 Change-Id: I05921969a84a303b60d1b3b9227aff9865662831 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
c48cc08de2
commit
1005cbc1e4
@@ -7,23 +7,15 @@ package tailscaleroot
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestToolchainMatches(t *testing.T) {
|
||||
bi, ok := debug.ReadBuildInfo()
|
||||
tsRev, ok := tailscaleToolchainRev()
|
||||
if !ok {
|
||||
t.Fatal("failed to read build info")
|
||||
}
|
||||
var tsRev string
|
||||
for _, s := range bi.Settings {
|
||||
if s.Key == "tailscale.toolchain.rev" {
|
||||
tsRev = s.Value
|
||||
break
|
||||
}
|
||||
}
|
||||
want := strings.TrimSpace(GoToolchainRev)
|
||||
if tsRev != want {
|
||||
if os.Getenv("TS_PERMIT_TOOLCHAIN_MISMATCH") == "1" {
|
||||
|
Reference in New Issue
Block a user