diff options
Diffstat (limited to 'src/make.bash')
-rwxr-xr-x | src/make.bash | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/make.bash b/src/make.bash index 933573dd9d..5b49fcccf7 100755 --- a/src/make.bash +++ b/src/make.bash @@ -159,14 +159,15 @@ if [[ -z "$GOROOT_BOOTSTRAP" ]]; then fi export GOROOT_BOOTSTRAP -nogoenv() { - GO111MODULE=off GOENV=off GOOS= GOARCH= GOEXPERIMENT= GOFLAGS= "$@" +bootstrapenv() { + GOROOT="$GOROOT_BOOTSTRAP" GO111MODULE=off GOENV=off GOOS= GOARCH= GOEXPERIMENT= GOFLAGS= "$@" } export GOROOT="$(cd .. && pwd)" IFS=$'\n'; for go_exe in $(type -ap go); do if [[ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]]; then - goroot=$(GOROOT= nogoenv "$go_exe" env GOROOT) + GOROOT_BOOTSTRAP="" + goroot=$(bootstrapenv "$go_exe" env GOROOT) if [[ "$goroot" != "$GOROOT" ]]; then if [[ "$goroot_bootstrap_set" == "true" ]]; then printf 'WARNING: %s does not exist, found %s from env\n' "$GOROOT_BOOTSTRAP/bin/go" "$go_exe" >&2 @@ -184,7 +185,7 @@ fi # 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=$(nogoenv "$GOROOT_BOOTSTRAP/bin/go" version | sed 's/go version //') +GOROOT_BOOTSTRAP_VERSION=$(bootstrapenv "$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 @@ -195,7 +196,7 @@ if [[ "$GOROOT_BOOTSTRAP" == "$GOROOT" ]]; then exit 1 fi rm -f cmd/dist/dist -GOROOT="$GOROOT_BOOTSTRAP" nogoenv "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist +bootstrapenv "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist # -e doesn't propagate out of eval, so check success by hand. eval $(./cmd/dist/dist env -p || echo FAIL=true) |