()
| 12 | ) |
| 13 | |
| 14 | func init() { |
| 15 | tsRev, ok := tailscaleToolchainRev() |
| 16 | if !ok { |
| 17 | panic("binary built with tailscale_go build tag but failed to read build info or find tailscale.toolchain.rev in build info") |
| 18 | } |
| 19 | want := strings.TrimSpace(GoToolchainRev) |
| 20 | // Also permit the "next" toolchain rev, which is used in the main branch and will eventually become the new "current" rev. |
| 21 | // This allows building with TS_GO_NEXT=1 and then running the resulting binary without TS_GO_NEXT=1. |
| 22 | wantAlt := strings.TrimSpace(GoToolchainNextRev) |
| 23 | if tsRev != want && tsRev != wantAlt { |
| 24 | if os.Getenv("TS_PERMIT_TOOLCHAIN_MISMATCH") == "1" { |
| 25 | fmt.Fprintf(os.Stderr, "tailscale.toolchain.rev = %q, want %q; but ignoring due to TS_PERMIT_TOOLCHAIN_MISMATCH=1\n", tsRev, want) |
| 26 | return |
| 27 | } |
| 28 | panic(fmt.Sprintf("binary built with tailscale_go build tag but Go toolchain %q doesn't match github.com/tailscale/tailscale expected value %q; override this failure with TS_PERMIT_TOOLCHAIN_MISMATCH=1", tsRev, want)) |
| 29 | } |
| 30 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…