version: validate Long format on Android builds

Updates #14069

Change-Id: I134a90db561dacc4b1c1c66ccadac135b5d64cf3
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2024-11-19 09:07:32 -08:00
committed by Brad Fitzpatrick
parent bb3d0cae5f
commit d62baa45e6
3 changed files with 85 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
// Copyright (c) Tailscale Inc & AUTHORS
// SPDX-License-Identifier: BSD-3-Clause
//go:build tailscale_go && android
package version
import "fmt"
func init() {
// For official Android builds using the tailscale_go toolchain,
// panic if the builder is screwed up we fail to stamp a valid
// version string.
if !isValidLongWithTwoRepos(Long()) {
panic(fmt.Sprintf("malformed version.Long value %q", Long()))
}
}