aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2021-12-06 13:36:42 -0500
committerRuss Cox <rsc@golang.org>2021-12-07 18:58:57 +0000
commit4300f105147dc0da9d1034704ad1cd24bedde5da (patch)
tree6049cf053d260d5982bca9b3236018b83b4ff931 /src/make.bash
parenta08bbd964dd037331b2693aff731ec2d8376a721 (diff)
downloadgo-4300f105147dc0da9d1034704ad1cd24bedde5da.tar.xz
build: for default bootstrap, use Go 1.17 if present, falling back to Go 1.4
Preparation for #44505, but safe for Go 1.18. Also fixes the default build on Macs, at least for people who have a $HOME/go1.17 or have run go install golang.org/dl/go1.17@latest go1.17 download Change-Id: I822f93e75498620fad87db2436376148c42f6bff Reviewed-on: https://go-review.googlesource.com/c/go/+/369914 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/make.bash b/src/make.bash
index 3310692a18..2d6c47272e 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -153,7 +153,14 @@ if [ "$1" = "-v" ]; then
fi
goroot_bootstrap_set=${GOROOT_BOOTSTRAP+"true"}
-export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
+if [ -z "$GOROOT_BOOTSTRAP" ]; then
+ GOROOT_BOOTSTRAP="$HOME/go1.4"
+ for d in sdk/go1.17 go1.17; do
+ if [ -d "$HOME/$d" ]; then
+ GOROOT_BOOTSTRAP="$HOME/$d"
+ fi
+ done
+fi
export GOROOT="$(cd .. && pwd)"
IFS=$'\n'; for go_exe in $(type -ap go); do
if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then