aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorFilippo Valsorda <hi@filippo.io>2017-11-01 01:05:48 -0400
committerRuss Cox <rsc@golang.org>2017-11-01 13:43:35 +0000
commitf1fa663b6d7c80109ad0ba690751daeb9e387061 (patch)
tree9d2e2cc5ab293783feff57b6b69f96fc3089942f /src/make.bash
parent371a5b494a7a0cb246a86e849b66ed022ef30c74 (diff)
downloadgo-f1fa663b6d7c80109ad0ba690751daeb9e387061.tar.gz
go-f1fa663b6d7c80109ad0ba690751daeb9e387061.zip
make.bash: show correct GOROOT_BOOTSTRAP when using `go env GOROOT`
Also, support spaces in go binaries locations, and document GOROOT_BOOTSTRAP at the top. Change-Id: I643d22df57aad9a2200cc256edd20e8c811bc70d Reviewed-on: https://go-review.googlesource.com/74951 Run-TryBot: Filippo Valsorda <hi@filippo.io> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/make.bash b/src/make.bash
index f3614f8e5b..e1c3d92610 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -55,6 +55,10 @@
# GOBUILDTIMELOGFILE: If set, make.bash and all.bash write
# timing information to this file. Useful for profiling where the
# time goes when these scripts run.
+#
+# GOROOT_BOOTSTRAP: A working Go tree >= Go 1.4 for bootstrap.
+# If $GOROOT_BOOTSTRAP/bin/go is missing, $(go env GOROOT) is
+# tried for all "go" in $PATH. $HOME/go1.4 by default.
set -e
@@ -134,19 +138,19 @@ if [ "$1" = "-v" ]; then
fi
export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
-echo "Building Go cmd/dist using $GOROOT_BOOTSTRAP."
-if $verbose; then
- echo cmd/dist
-fi
export GOROOT="$(cd .. && pwd)"
-for go_exe in $(type -ap go); do
+IFS=$'\n'; for go_exe in $(type -ap go); do
if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
- goroot=$(GOROOT='' $go_exe env GOROOT)
+ goroot=$(GOROOT='' "$go_exe" env GOROOT)
if [ "$goroot" != "$GOROOT" ]; then
GOROOT_BOOTSTRAP=$goroot
fi
fi
-done
+done; unset IFS
+echo "Building Go cmd/dist using $GOROOT_BOOTSTRAP."
+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