Skip to content

vcbuild changes current directory and fails to find python #14300

Description

@seishun
  • Version: master
  • Platform: Windows 10 64-bit
  • Subsystem: build
C:\Users\Nikolai\Downloads\node>python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:32:19) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z


C:\Users\Nikolai\Downloads\node>vcbuild
Looking for Visual Studio 2017
calling: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\\Auxiliary\Build\vcvarsall.bat" amd64
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26430.14
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Found MSVS version 15.0
The system cannot find the path specified.
Could not find python2
Failed to create vc project files.

C:\Users\Nikolai\Source>

cc @refack

Activity

  1. seishun commented on Jul 16, 2017

    @seishun
    ContributorAuthor

    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\Source
    

    Why would that happen?

  2. refack commented on Jul 16, 2017

    @refack
    Contributor

    Funny I was just discussing this with @gibfahn...

    • The 3rd line in vcbuild.bat is cd %~dp0 so that's probably the cause of changing directory ohh vcvarsall.bat is changing your cd, that is strange, check the %ERRORLEVEL%, maybe it's failing.
    • Check what tools/msvs/find_python.cmd is doing with set DEBUG_HELPER=1.
      Maybe your python is not an .exe but .bat? (find_python.cmd#42)
  3. refack commented on Jul 16, 2017

    @refack
    Contributor

    Maybe also try to run "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" and do a Repair or Update

  4. seishun commented on Jul 16, 2017

    @seishun
    ContributorAuthor

    vcvarsall.bat is changing your cd, that is strange, check the %ERRORLEVEL%, maybe it's failing.

    C:\Users\Nikolai\Source>echo %ERRORLEVEL%
    1
    

    Check 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.

  5. refack commented on Jul 16, 2017

    @refack
    Contributor

    Sorry it's my ideas are coming in drips...
    You can also see what vcvarsall.bat is doing with set VSCMD_DEBUG=3 (it has several levels I think 3 is the highest)

  6. refack commented on Jul 16, 2017

    @refack
    Contributor

    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 👍

  7. seishun commented on Jul 16, 2017

    @seishun
    ContributorAuthor

    Looks like ERRORLEVEL is set to 1 later and vcvarsall.bat is 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.
    
  8. 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
  9. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    windowsIssues and PRs related to the Windows platform.
    on Jul 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildIssues and PRs related to Node.js builds or CI infrastructure.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions