Repository navigation
vcbuild changes current directory and fails to find python #14300
Description
Activity
Added some
echo %cd%in vcbuild.bat, apparently calling vcvarsall changes the current directory:echo calling: %vcvars_call% echo %cd% call %vcvars_call% echo %cd%calling: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\\Auxiliary\Build\vcvarsall.bat" amd64 C:\Users\Nikolai\Downloads\node ********************************************************************** ** Visual Studio 2017 Developer Command Prompt v15.0.26430.14 ** Copyright (c) 2017 Microsoft Corporation ********************************************************************** [vcvarsall.bat] Environment initialized for: 'x64' C:\Users\Nikolai\SourceWhy would that happen?
Funny I was just discussing this with @gibfahn...
The 3rd line inohhvcbuild.batiscd %~dp0so that's probably the cause of changing directoryvcvarsall.batis changing yourcd, that is strange, check the %ERRORLEVEL%, maybe it's failing.- Check what
tools/msvs/find_python.cmdis doing withset DEBUG_HELPER=1.
Maybe yourpythonis not an.exebut.bat? (find_python.cmd#42)
Maybe also try to run
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe"and do aRepairorUpdatevcvarsall.bat is changing your cd, that is strange, check the %ERRORLEVEL%, maybe it's failing.
C:\Users\Nikolai\Source>echo %ERRORLEVEL% 1Check what tools/msvs/find_python.cmd is doing with set DEBUG_HELPER=1.
find_python.cmd doesn't even run because the current directory is wrong. Thus the "The system cannot find the path specified." line.
Maybe also try to run "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" and do a Repair or Update
I could do that, but vcbuild shouldn't fail in such an obscure way because of a broken VS installation.
Sorry it's my ideas are coming in drips...
You can also see whatvcvarsall.batis doing withset VSCMD_DEBUG=3(it has several levels I think 3 is the highest)I could do that, but vcbuild shouldn't fail in such an obscure way because of a broken VS installation.
Ack. So now we have a bug 👍
Looks like
ERRORLEVELis set to1later andvcvarsall.batis successful:diff --git a/vcbuild.bat b/vcbuild.bat index 03cf82565d..f8af97bbe9 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -176,9 +176,11 @@ if "_%VisualStudioVersion%_" == "_15.0_" if "_%VSCMD_ARG_TGT_ARCH%_"=="_%target_ set "VSINSTALLDIR=" call tools\msvs\vswhere_usability_wrapper.cmd if "_%VCINSTALLDIR%_" == "__" goto vs-set-2015 +echo error before calling: %ERRORLEVEL% set vcvars_call="%VCINSTALLDIR%\Auxiliary\Build\vcvarsall.bat" %vcvarsall_arg% echo calling: %vcvars_call% call %vcvars_call% +echo error after calling: %ERRORLEVEL% if errorlevel 1 goto vs-set-2015 :found_vs2017 echo Found MSVS version %VisualStudioVersion%
Output with
set VSCMD_DEBUG=3:C:\Users\Nikolai\Downloads\node>vcbuild Looking for Visual Studio 2017 error before calling: 0 calling: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\\Auxiliary\Build\vcvarsall.bat" amd64 [DEBUG:vcvarsall.bat] init with arguments 'amd64' [DEBUG:vcvarsall.bat] inner argument {amd64} [DEBUG:vcvarsall.bat] Command line parse completed with values: [DEBUG:vcvarsall.bat] __VCVARSALL_TARGET_ARCH='x64' [DEBUG:vcvarsall.bat] __VCVARSALL_HOST_ARCH='x64' [DEBUG:vcvarsall.bat] __VCVARSALL_WINSDK='' [DEBUG:vcvarsall.bat] __VCVARSALL_STORE='' [DEBUG:vcvarsall.bat] __VCVARSALL_HELP='' [DEBUG:vcvarsall.bat] __VCVARSALL_PARSE_ERROR='0' [DEBUG:VsDevCmd] Writing pre-initialization environment to C:\Users\Nikolai\AppData\Local\Temp\dd_vsdevcmd15_preinit_env.log [DEBUG:core\vsdevcmd_start] initializing with arguments '' [DEBUG:core\parse_cmd.bat] initializaing with arguments '' [DEBUG:parse_cmd] inner argument {-arch, x64} [DEBUG:parse_cmd] inner argument {-host_arch, x64} [DEBUG:parse_cmd] -no_ext : [DEBUG:parse_cmd] -winsdk : [DEBUG:parse_cmd] -app_platform : [DEBUG:parse_cmd] -test : [DEBUG:parse_cmd] -help : [DEBUG:parse_cmd] -arch : x64 [DEBUG:parse_cmd] -host_arch : x64 [DEBUG:vsdevcmd_start] Parsing results... [DEBUG:vsdevcmd_start] -clean_env : [DEBUG:vsdevcmd_start] -test : [DEBUG:vsdevcmd_start] -help : [DEBUG:vsdevcmd_start] end of script: VS150COMNTOOLS="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\" [DEBUG:vsdevcmd_start] end of script: VSINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\" [DEBUG:vsdevcmd_start] end of script: DevEnvDir="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\" [DEBUG:VsDevCmd.bat] check_vernum checking 'Version' [DEBUG:VsDevCmd.bat] check_vernum checking '15.0.26430.14' [DEBUG:VsDevCmd.bat] check_vernum checking '' [DEBUG:VsDevCmd.bat] devenv.exe found. Setting VSCMD_VER='15.0.26430.14'. ********************************************************************** ** Visual Studio 2017 Developer Command Prompt v15.0.26430.14 ** Copyright (c) 2017 Microsoft Corporation ********************************************************************** [DEBUG:VsDevCmd.bat] -clean_env : [DEBUG:VsDevCmd.bat] -test : [DEBUG:VsDevCmd.bat] VS150COMNTOOLS : "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\" [DEBUG:VsDevCmd.bat] calling "core\dotnet.bat" [vsdevcmd\core\dotnet.bat] initializing... [DEBUG:core\dotnet.bat] Adding 64-bit .NET Framework Path [DEBUG:core\dotnet.bat] Framework Preference: 64bit [DEBUG:core\dotnet.bat] appending '\' to FrameworkDir. [DEBUG:core\dotnet.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "core\msbuild.bat" [DEBUG:core\msbuild.bat] initializing... [DEBUG:core\msbuild.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "core\winsdk.bat" [DEBUG:winsdk.bat] initializing... [DEBUG:core\winsdk.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\netfxsdk.bat" [DEBUG:ext\netfxsdk.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\perf_tools.bat" ERROR: The system was unable to find the specified registry key or value. [DEBUG:~nx0] after reg query 'HKLM\SOFTWARE', __collection_tools='' [DEBUG:~nx0] after reg query 'HKLM\SOFTWARE\Wow6432Node', __collection_tools='C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\' [DEBUG:ext\perf_tools.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\roslyn.bat" [DEBUG:ext\roslyn.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\team_explorer.bat" [DEBUG:ext\team_explorer.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\testwindow.bat" [DEBUG:ext\testwindow.bat] init:COMPLETE [DEBUG:VsDevCmd.bat] calling "ext\vcvars.bat" [DEBUG:vcvars.bat] Checking architecture { host , tgt } : { x64 , x64 } [DEBUG:vcvars.bat] Could not add directory to IFCPATH: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\ifc\x64" [DEBUG:ext\vcvars.bat] init:COMPLETE [DEBUG:core\vsdevcmd_end] initializing with arguments '' [DEBUG:VsDevCmd] Writing post-execution environment to C:\Users\Nikolai\AppData\Local\Temp\dd_vsdevcmd15_env.log [vcvarsall.bat] Environment initialized for: 'x64' error after calling: 0 Found MSVS version 15.0 The system cannot find the path specified. Could not find python2 Failed to create vc project files.- changed the title
[-]vcbuild fails to find python and changes current directory[/-][+]vcbuild changes current directory and fails to find python[/+]on Jul 16, 2017 - addedbuildIssues and PRs related to Node.js builds or CI infrastructure.Issues and PRs related to Node.js builds or CI infrastructure.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
on Jul 16, 2017 - added a commit that references this issue
on Jul 18, 2017 - added a commit that references this issue
on Jul 19, 2017 - added a commit that references this issue
on Jul 27, 2026
cc @refack