tool/gocross: handle VERSION file not found

Fixes #9734

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/9099/merge
Maisem Ali 1 year ago committed by Maisem Ali
parent ba6ec42f6d
commit 56c0a75ea9

@ -32,7 +32,10 @@ if [[ -d "$toolchain" ]]; then
# A toolchain exists, but is it recent enough to compile gocross? If not, # A toolchain exists, but is it recent enough to compile gocross? If not,
# wipe it out so that the next if block fetches a usable one. # wipe it out so that the next if block fetches a usable one.
want_go_minor=$(grep -E '^go ' "go.mod" | cut -f2 -d'.') want_go_minor=$(grep -E '^go ' "go.mod" | cut -f2 -d'.')
have_go_minor=""
if [[ -f "$toolchain/VERSION" ]]; then
have_go_minor=$(head -1 "$toolchain/VERSION" | cut -f2 -d'.') have_go_minor=$(head -1 "$toolchain/VERSION" | cut -f2 -d'.')
fi
# Shortly before stable releases, we run release candidate # Shortly before stable releases, we run release candidate
# toolchains, which have a non-numeric suffix on the version # toolchains, which have a non-numeric suffix on the version
# number. Remove the rc qualifier, we just care about the minor # number. Remove the rc qualifier, we just care about the minor

Loading…
Cancel
Save