#!/usr/bin/env sh # # Runs `go build` with flags configured for binary distribution. All # it does differently from `go build` is burn git commit and version # information into the binaries, so that we can track down user # issues. # # If you're packaging Tailscale for a distro, please consider using # this script, or executing equivalent commands in your # distro-specific build system. set -eu go="go" if [ -n "${TS_USE_TOOLCHAIN:-}" ]; then go="./tool/go" fi eval `CGO_ENABLED=0 GOOS=$($go env GOHOSTOS) GOARCH=$($go env GOHOSTARCH) $go run ./cmd/mkversion` if [ "$1" = "shellvars" ]; then cat <