From: Bryan C. Mills Date: Fri, 1 Apr 2022 19:36:17 +0000 (-0400) Subject: run.bat: use cmd/dist instead of 'go install' to rebuild std and cmd X-Git-Tag: go1.19beta1~759 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5210a7128563e64952d432a0efd2d38c32cd090c;p=gostls13.git run.bat: use cmd/dist instead of 'go install' to rebuild std and cmd cmd/dist may set and/or unset variables before building, and at any rate it is fragile to run 'go install' before sourcing env.bat. The build-stamp information embedded by the 'go' command is currently sensitive to whether CGO_* variables are implicit or explicit, so running 'go install' before env.bat may cause stamped metadata to become stale. (Explicitly setting to the default arguably ought to produce the same metadata as leaving the variables unset, but that's a separate issue and a bigger cleanup.) Moreover, run.bat is supposed to parallel run.bash, and run.bash already hasn't invoked 'go install' itself since CL 6531! For #52009 Change-Id: Ie35217913f02cc7e0c3f9b12874abd7416473478 Reviewed-on: https://go-review.googlesource.com/c/go/+/398060 Trust: Bryan Mills Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Reviewed-by: Dmitri Shuralyov --- diff --git a/src/run.bat b/src/run.bat index edcaf52659..1f16c493bb 100644 --- a/src/run.bat +++ b/src/run.bat @@ -24,26 +24,20 @@ set GOBIN= set GOFLAGS= set GO111MODULE= -rem TODO avoid rebuild if possible - -if x%1==x--no-rebuild goto norebuild -echo ##### Building packages and commands. -..\bin\go install -a -v std cmd -if errorlevel 1 goto fail -echo. -:norebuild - :: get CGO_ENABLED ..\bin\go env > env.bat if errorlevel 1 goto fail call env.bat del env.bat -echo. -..\bin\go tool dist test +if x%1==x--no-rebuild goto norebuild +..\bin\go tool dist test --rebuild if errorlevel 1 goto fail -echo. +goto end +:norebuild +..\bin\go tool dist test +if errorlevel 1 goto fail goto end :fail