Skip to content

Commit 07d19b2

Browse files
committed
all: check GOROOT_BOOTSTRAP executable before bootsrappping
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Emmanuel Odeke <[email protected]>
1 parent dfdc388 commit 07d19b2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/make.bash

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,16 @@ IFS=$'\n'; for go_exe in $(type -ap go); do
162162
fi
163163
fi
164164
done; unset IFS
165-
GOROOT_BOOTSTRAP_VERSION=$($GOROOT_BOOTSTRAP/bin/go version | sed 's/go version //')
166-
echo "Building Go cmd/dist using $GOROOT_BOOTSTRAP. ($GOROOT_BOOTSTRAP_VERSION)"
167-
if $verbose; then
168-
echo cmd/dist
169-
fi
170165
if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
171166
echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
172167
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
173168
exit 1
174169
fi
170+
GOROOT_BOOTSTRAP_VERSION=$($GOROOT_BOOTSTRAP/bin/go version | sed 's/go version //')
171+
echo "Building Go cmd/dist using $GOROOT_BOOTSTRAP. ($GOROOT_BOOTSTRAP_VERSION)"
172+
if $verbose; then
173+
echo cmd/dist
174+
fi
175175
if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
176176
echo "ERROR: \$GOROOT_BOOTSTRAP must not be set to \$GOROOT" >&2
177177
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2

0 commit comments

Comments
 (0)