aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2020-09-21 09:18:32 -0400
committerAustin Clements <austin@google.com>2020-09-21 16:50:07 +0000
commiteda1d405444262ab36160b87179e086872804709 (patch)
tree32b0fe5c49c72717ad307a543bddeaf76199d832 /src/make.bash
parent02ff8b8ce49c7c8f1180ee6e915b867368ad77d3 (diff)
downloadgo-eda1d405444262ab36160b87179e086872804709.tar.gz
go-eda1d405444262ab36160b87179e086872804709.zip
make.bash: avoid warning when bootstrap doesn't support GOOS/GOARCH
Currently, if make.bash is run with a GOOS or GOARCH that the bootstrap toolchain doesn't support, it will print an ominous but harmless warning like: 2020/09/21 09:05:27 unsupported GOARCH arm64 This comes from the invocation of "go version" to get the exact bootstrap toolchain version. Since the GOOS and GOARCH don't matter for this purpose, this CL simply clears them on the invocation of the bootstrap toolchain's "go version". Fixes #41525. Change-Id: I17d44eaafed9999b9fa7dcb9fb100b5fd5e554d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/256297 Trust: Austin Clements <austin@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/make.bash b/src/make.bash
index 3a84658c72..b58f27bb1b 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -167,7 +167,10 @@ if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
exit 1
fi
-GOROOT_BOOTSTRAP_VERSION=$($GOROOT_BOOTSTRAP/bin/go version | sed 's/go version //')
+# Get the exact bootstrap toolchain version to help with debugging.
+# We clear GOOS and GOARCH to avoid an ominous but harmless warning if
+# the bootstrap doesn't support them.
+GOROOT_BOOTSTRAP_VERSION=$(GOOS= GOARCH= $GOROOT_BOOTSTRAP/bin/go version | sed 's/go version //')
echo "Building Go cmd/dist using $GOROOT_BOOTSTRAP. ($GOROOT_BOOTSTRAP_VERSION)"
if $verbose; then
echo cmd/dist