Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit d22637c

Browse files
committed
build: vcbuild fix "The input line is too long."
vcbuild.bat is calling vcvars.bat, which doesn't detect if the environment has already been set. This causes repeated entries to be added to the PATH, which after a few invocations will lead to an error: The input line is too long.
1 parent 874dd59 commit d22637c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

vcbuild.bat

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ if defined nobuild goto sign
108108
@rem Look for Visual Studio 2013
109109
if not defined VS120COMNTOOLS goto vc-set-2012
110110
if not exist "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2012
111-
call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat"
111+
if "%VCVARS_VER%" NEQ "120" (
112+
call "%VS120COMNTOOLS%\..\..\vc\vcvarsall.bat"
113+
SET VCVARS_VER=120
114+
)
112115
if not defined VCINSTALLDIR goto msbuild-not-found
113116
set GYP_MSVS_VERSION=2013
114117
goto msbuild-found
@@ -117,15 +120,21 @@ goto msbuild-found
117120
@rem Look for Visual Studio 2012
118121
if not defined VS110COMNTOOLS goto vc-set-2010
119122
if not exist "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat" goto vc-set-2010
120-
call "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat"
123+
if "%VCVARS_VER%" NEQ "110" (
124+
call "%VS110COMNTOOLS%\..\..\vc\vcvarsall.bat"
125+
SET VCVARS_VER=110
126+
)
121127
if not defined VCINSTALLDIR goto msbuild-not-found
122128
set GYP_MSVS_VERSION=2012
123129
goto msbuild-found
124130

125131
:vc-set-2010
126132
if not defined VS100COMNTOOLS goto msbuild-not-found
127133
if not exist "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat" goto msbuild-not-found
128-
call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat"
134+
if "%VCVARS_VER%" NEQ "100" (
135+
call "%VS100COMNTOOLS%\..\..\vc\vcvarsall.bat"
136+
SET VCVARS_VER=100
137+
)
129138
if not defined VCINSTALLDIR goto msbuild-not-found
130139
goto msbuild-found
131140

0 commit comments

Comments
 (0)