]> Cypherpunks repositories - gostls13.git/commit
make.bat: fix GOROOT_BOOTSTRAP detection
author0x2b3bfa0 <0x2b3bfa0+git@googlemail.com>
Fri, 28 Feb 2025 09:05:52 +0000 (10:05 +0100)
committerGopher Robot <gobot@golang.org>
Thu, 3 Apr 2025 15:45:30 +0000 (08:45 -0700)
commit9326d9d01231a1834458810c3cb01701bf7293a9
tree0209a63978844b26ddc8ca0aa55134d9205edd34
parentfd8f6cec213a6eaf862998073ea3c4ee52b182ba
make.bat: fix GOROOT_BOOTSTRAP detection

Due to a flaw in the %GOROOT_BOOTSTRAP% detection logic, the last Go
executable found by `where go` was taking precedence over the first one.

In batch scripts, environment variable expansion happens when each line
of the script is read, not when it is executed. Thus, the check in the
loop for GOROOT_BOOTSTRAP being unset would always be true, even when
the variable had been set in a previous loop iteration.

See SET /? for more information.

Change-Id: I15ddcbe771a902acb47a1f07ba7f4cb8a311e0dc
Reviewed-on: https://go-review.googlesource.com/c/go/+/653535
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/make.bat