mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-05 20:26:47 +02:00
tool/gocross: make gocross-wrapper use GOCROSS_WANTVER if set instead of git
To run tests in an environment without a git checkout and just the bare files (from git archive) Updates #9841 Change-Id: Ibaf5e230cd8e6af7b25540b773df54d3e1ac25e1 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
70f9c8a6ed
commit
bb93ec5d32
@ -90,7 +90,10 @@ fi
|
||||
# Anyway, build gocross in a stripped down universe.
|
||||
gocross_path="gocross"
|
||||
gocross_ok=0
|
||||
wantver="$(git rev-parse HEAD)"
|
||||
wantver="${GOCROSS_WANTVER:-}"
|
||||
if [[ "$wantver" == "" ]]; then
|
||||
wantver="$(git rev-parse HEAD)"
|
||||
fi
|
||||
if [[ -x "$gocross_path" ]]; then
|
||||
gotver="$($gocross_path gocross-version 2>/dev/null || echo '')"
|
||||
if [[ "$gotver" == "$wantver" ]]; then
|
||||
|
||||
@ -15,6 +15,9 @@ import (
|
||||
)
|
||||
|
||||
func toolchainRev() (string, error) {
|
||||
if v := os.Getenv("GO_TOOLCHAIN_REV"); v != "" {
|
||||
return v, nil
|
||||
}
|
||||
// gocross gets built in the root of the repo that has toolchain
|
||||
// information, so we can use os.Args[0] to locate toolchain info.
|
||||
//
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user