]> Cypherpunks repositories - gostls13.git/commitdiff
make.bat, make.rc: show bootstrap toolchain version
authorRuss Cox <rsc@golang.org>
Tue, 26 Jul 2022 18:21:03 +0000 (14:21 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 3 Aug 2022 19:52:27 +0000 (19:52 +0000)
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 <dmitshur@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
src/make.bat
src/make.rc

index 8f434708196761b0acc1c7b0014066c03b6cfb7e..29a9cce888986f99fe529f4eb3f742320aa34365 100644 (file)
@@ -89,14 +89,16 @@ if not exist "%GOROOT_BOOTSTRAP%\bin\go.exe" goto bootstrapfail
 set GOROOT=%GOROOT_TEMP%\r
 set GOROOT_TEMP=\r
 \r
-echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%\r
-if x%vflag==x-v echo cmd/dist\r
 setlocal\r
-set GOROOT=%GOROOT_BOOTSTRAP%\r
 set GOOS=\r
 set GOARCH=\r
-set GOBIN=\r
 set GOEXPERIMENT=\r
+for /f "tokens=*" %%g IN ('%GOROOT_BOOTSTRAP%\bin\go version') do (set GOROOT_BOOTSTRAP_VERSION=%%g)\r
+set GOROOT_BOOTSTRAP_VERSION=%GOROOT_BOOTSTRAP_VERSION:go version =%\r
+echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%. (%GOROOT_BOOTSTRAP_VERSION%)\r
+if x%vflag==x-v echo cmd/dist\r
+set GOROOT=%GOROOT_BOOTSTRAP%\r
+set GOBIN=\r
 set GO111MODULE=off\r
 set GOENV=off\r
 set GOFLAGS=\r
index 4597403a041366e1bfd4c7e3defce3605c5120ba..d9c7f2d8170a9ac666fe7db69501025c2e09bfd8 100755 (executable)
@@ -81,7 +81,11 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
        exit bootstrap
 }
 
-echo 'Building Go cmd/dist using '^$GOROOT_BOOTSTRAP
+# 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=`{GOOS='' GOARCH='' GOEXPERIMENT='' $GOROOT_BOOTSTRAP/bin/go version | sed 's/go version //'}
+echo 'Building Go cmd/dist using '$GOROOT_BOOTSTRAP'. ('$"GOROOT_BOOTSTRAP_VERSION')'
 if(~ $#vflag 1)
        echo cmd/dist
 GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GOEXPERIMENT='' GO111MODULE=off GOENV=off GOFLAGS='' $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist