diff options
| author | qmuntal <quimmuntal@gmail.com> | 2025-02-11 18:23:11 +0000 |
|---|---|---|
| committer | Quim Muntal <quimmuntal@gmail.com> | 2025-02-11 23:09:26 -0800 |
| commit | 30f515898c9852f0529fe42b46c8b89d00e14949 (patch) | |
| tree | 1224439e115923140151497e480af4432582377b /src/make.bat | |
| parent | b941d2b6d8bd9663abec7761de366b09a2be7445 (diff) | |
| download | go-30f515898c9852f0529fe42b46c8b89d00e14949.tar.xz | |
make.bat,race.bat: simplify --dist-tool handling
make.bat accepts the --dist-tool flag on multiple flag positions
and also allows omitting the trailing dash. Doing so adds complexity
and is not aligned with the make.bash and make.rc behavior. Remove that
flexibility to simplify the code and make it more consistent. This also
fixes a bug where dist.exe wouldn't be removed from cmd\dist when
running make.bat --dist-tool.
Also, there is no need for race.bat to invoke make.bat with --dist-tool.
It uses it to get the GOHOSTARCH env value, but we can already get
that from the built-in PROCESSOR_ARCHITECTURE env variable.
Change-Id: Ia673562c1ae6aff9bd3ec7aa8cdd25ff187eeb79
Reviewed-on: https://go-review.googlesource.com/c/go/+/648615
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/make.bat')
| -rw-r--r-- | src/make.bat | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/make.bat b/src/make.bat index 890829131b..6c683230ce 100644 --- a/src/make.bat +++ b/src/make.bat @@ -101,14 +101,14 @@ call .\env.bat del env.bat
if x%vflag==x-v echo.
-if x%1==x-dist-tool goto copydist
-if x%2==x-dist-tool goto copydist
-if x%3==x-dist-tool goto copydist
-if x%4==x-dist-tool goto copydist
-if x%1==x--dist-tool goto copydist
-if x%2==x--dist-tool goto copydist
-if x%3==x--dist-tool goto copydist
-if x%4==x--dist-tool goto copydist
+if x%1==x--dist-tool (
+ mkdir "%GOTOOLDIR%" 2>NUL
+ if not x%2==x (
+ copy cmd\dist\dist.exe "%2"
+ )
+ move cmd\dist\dist.exe "%GOTOOLDIR%\dist.exe"
+ goto :eof
+)
:: Run dist bootstrap to complete make.bash.
:: Bootstrap installs a proper cmd/dist, built with the new toolchain.
@@ -123,11 +123,6 @@ goto :eof :: to avoid needing three copies in three different shell languages
:: (make.bash, make.bat, make.rc).
-:copydist
-mkdir "%GOTOOLDIR%" 2>NUL
-copy cmd\dist\dist.exe "%GOTOOLDIR%\"
-goto :eof
-
:nogoenv
set GO111MODULE=off
set GOENV=off
|
