From 07d19b2597af253ed78ef43ba6e7a49db9a8f4ba Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 10 Sep 2020 13:21:41 +0700 Subject: all: check GOROOT_BOOTSTRAP executable before bootsrappping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we’d still be writing that we're building cmd/dist even if GOROOT_BOOTSTRAP we’re wrongly set. Change-Id: I940e18c3cebae5664f85babc9919e9eb215d5093 Reviewed-on: https://go-review.googlesource.com/c/go/+/253877 Run-TryBot: Cuong Manh Le TryBot-Result: Gobot Gobot Reviewed-by: Emmanuel Odeke --- src/make.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/make.bash') diff --git a/src/make.bash b/src/make.bash index 880a0f43d5..3a84658c72 100755 --- a/src/make.bash +++ b/src/make.bash @@ -162,16 +162,16 @@ IFS=$'\n'; for go_exe in $(type -ap go); do fi fi done; unset IFS -GOROOT_BOOTSTRAP_VERSION=$($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 -fi if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2 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 //') +echo "Building Go cmd/dist using $GOROOT_BOOTSTRAP. ($GOROOT_BOOTSTRAP_VERSION)" +if $verbose; then + echo cmd/dist +fi if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then echo "ERROR: \$GOROOT_BOOTSTRAP must not be set to \$GOROOT" >&2 echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2 -- cgit v1.3 From eda1d405444262ab36160b87179e086872804709 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 21 Sep 2020 09:18:32 -0400 Subject: 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 Reviewed-by: Brad Fitzpatrick Reviewed-by: David Chase Run-TryBot: Austin Clements TryBot-Result: Go Bot --- src/make.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/make.bash') 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 -- cgit v1.3