tool/gocross: disable Linux static linking if GOCROSS_STATIC=0

So we can experiment with disabling static linking for tests in CI to
make GitHub Actions output less spammy.

Updates tailscale/corp#13113

Signed-off-by: Brad Fitzpatrick <brad@danga.com>
pull/9572/head
Brad Fitzpatrick 1 year ago
parent 5d62b17cc5
commit 2c0f0ee759

@ -6,6 +6,7 @@ package main
import ( import (
"fmt" "fmt"
"runtime" "runtime"
"strconv"
"strings" "strings"
"tailscale.com/version/mkversion" "tailscale.com/version/mkversion"
@ -62,6 +63,9 @@ func autoflagsForTest(argv []string, env *Environment, goroot, nativeGOOS, nativ
switch targetOS { switch targetOS {
case "linux": case "linux":
if v, _ := strconv.ParseBool(env.Get("GOCROSS_STATIC", "1")); !v {
break
}
// Getting Go to build a static binary with cgo enabled is a // Getting Go to build a static binary with cgo enabled is a
// minor ordeal. The incantations you apparently need are // minor ordeal. The incantations you apparently need are
// documented at: https://github.com/golang/go/issues/26492 // documented at: https://github.com/golang/go/issues/26492

Loading…
Cancel
Save