Skip to content

Commit f28fa95

Browse files
committed
make.bat, make.rc: show bootstrap toolchain version
Print the bootstrap toolchain version on Plan 9 and Windows, same as on all Unix systems since CL 204757 (Nov 2019). This makes it easier to see what is going on in a build. For #44505. Change-Id: I50cdd5e15a7c8b908e33e92780f8a3bca65c91ef Reviewed-on: https://go-review.googlesource.com/c/go/+/419452 Reviewed-by: Dmitri Shuralyov <[email protected]> Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 8738480 commit f28fa95

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/make.bat

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,16 @@ if not exist "%GOROOT_BOOTSTRAP%\bin\go.exe" goto bootstrapfail
8989
set GOROOT=%GOROOT_TEMP%
9090
set GOROOT_TEMP=
9191

92-
echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%
93-
if x%vflag==x-v echo cmd/dist
9492
setlocal
95-
set GOROOT=%GOROOT_BOOTSTRAP%
9693
set GOOS=
9794
set GOARCH=
98-
set GOBIN=
9995
set GOEXPERIMENT=
96+
for /f "tokens=*" %%g IN ('%GOROOT_BOOTSTRAP%\bin\go version') do (set GOROOT_BOOTSTRAP_VERSION=%%g)
97+
set GOROOT_BOOTSTRAP_VERSION=%GOROOT_BOOTSTRAP_VERSION:go version =%
98+
echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%. (%GOROOT_BOOTSTRAP_VERSION%)
99+
if x%vflag==x-v echo cmd/dist
100+
set GOROOT=%GOROOT_BOOTSTRAP%
101+
set GOBIN=
100102
set GO111MODULE=off
101103
set GOENV=off
102104
set GOFLAGS=

src/make.rc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
8181
exit bootstrap
8282
}
8383

84-
echo 'Building Go cmd/dist using '^$GOROOT_BOOTSTRAP
84+
# Get the exact bootstrap toolchain version to help with debugging.
85+
# We clear GOOS and GOARCH to avoid an ominous but harmless warning if
86+
# the bootstrap doesn't support them.
87+
GOROOT_BOOTSTRAP_VERSION=`{GOOS='' GOARCH='' GOEXPERIMENT='' $GOROOT_BOOTSTRAP/bin/go version | sed 's/go version //'}
88+
echo 'Building Go cmd/dist using '$GOROOT_BOOTSTRAP'. ('$"GOROOT_BOOTSTRAP_VERSION')'
8589
if(~ $#vflag 1)
8690
echo cmd/dist
8791
GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GOEXPERIMENT='' GO111MODULE=off GOENV=off GOFLAGS='' $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist

0 commit comments

Comments
 (0)