aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorCuong Manh Le <cuong.manhle.vn@gmail.com>2021-09-03 02:00:01 +0700
committerCuong Manh Le <cuong.manhle.vn@gmail.com>2021-09-02 19:16:19 +0000
commit9633195ae1e1a545c24eb71202c5c5f8965d2c4a (patch)
treeeea08a7bcbb845e9d073fa5dfcf6879e5114098e /src/make.bash
parent7609b5070174905478ba33876679c9b592367a5c (diff)
downloadgo-9633195ae1e1a545c24eb71202c5c5f8965d2c4a.tar.gz
go-9633195ae1e1a545c24eb71202c5c5f8965d2c4a.zip
src: do not emit warning when GOROOT_BOOTSTRAP is unset
Fixes #48155 Change-Id: I610a20d3af55035bb0b1047509361b204253801e Reviewed-on: https://go-review.googlesource.com/c/go/+/347273 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/make.bash b/src/make.bash
index 9ff471d863..3310692a18 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -152,14 +152,17 @@ if [ "$1" = "-v" ]; then
shift
fi
+goroot_bootstrap_set=${GOROOT_BOOTSTRAP+"true"}
export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
export GOROOT="$(cd .. && pwd)"
IFS=$'\n'; for go_exe in $(type -ap go); do
if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
goroot=$(GOROOT='' GOOS='' GOARCH='' "$go_exe" env GOROOT)
if [ "$goroot" != "$GOROOT" ]; then
- printf 'WARNING: %s does not exist, found %s from env\n' "$GOROOT_BOOTSTRAP/bin/go" "$go_exe" >&2
- printf 'WARNING: set %s as GOROOT_BOOTSTRAP\n' "$goroot" >&2
+ if [ "$goroot_bootstrap_set" = "true" ]; then
+ printf 'WARNING: %s does not exist, found %s from env\n' "$GOROOT_BOOTSTRAP/bin/go" "$go_exe" >&2
+ printf 'WARNING: set %s as GOROOT_BOOTSTRAP\n' "$goroot" >&2
+ fi
GOROOT_BOOTSTRAP=$goroot
fi
fi