Skip to content

Start-PSBuild failing on Windows #1715

Closed

Description

PS C:\Users\slee\Repos\PowerShell> Start-PSBuild
WARNING: Could not find 'dotnet', appending C:\Users\slee\AppData\Local\Microsoft\dotnet to PATH.
Get-ChildItem : Cannot find path 'C:\Program Files (x86)\Windows Kits\1' because it does not exist.
At C:\Users\slee\Repos\PowerShell\build.psm1:133 char:18

  • ... $mcexe = Get-ChildItem "${env:ProgramFiles(x86)}\Windows Kits\10" ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (C:\Program Files (x86)\Windows Kits\1:String) [Get-ChildItem], ItemNotF
      oundException
    • FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

mc.exe not found. Run Start-PSBootstrap or install Microsoft Windows 10 SDK from
https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk
At C:\Users\slee\Repos\PowerShell\build.psm1:135 char:13

  •         throw 'mc.exe not found. Run Start-PSBootstrap or install ...
    
  •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (mc.exe not foun.../windows-10-sdk:String) [], RuntimeException
    • FullyQualifiedErrorId : mc.exe not found. Run Start-PSBootstrap or install Microsoft Windows 10 SDK from https:/
      /developer.microsoft.com/en-US/windows/downloads/windows-10-sdk

Start-PSBootStrap reports that everything needed is installed including Win10 SDK

Activity

  1. andyleejordan commented on Aug 11, 2016

    @andyleejordan
    Member

    This doesn't look like Start-PSBuild is broken; it's accurately reporting that it couldn't find the required build tool mc.exe. I followed the link it provided, ran the installer, and then found mc.exe in my path.

    Start-PSBootrap installs it through chocolately, perhaps the package is broken.

  2. SteveL-MSFT commented on Aug 12, 2016

    @SteveL-MSFT
    MemberAuthor

    Manually installing the SDK via choco got mc.exe installed, but now it's not finding a VS file:
    Could not find Visual Studio vcvarsall.bat atC:\Program Files (x86)\Microsoft Visual Studio 14.0\vc
    At C:\Users\slee\Repos\PowerShell\build.psm1:140 char:13

    •         throw "Could not find Visual Studio vcvarsall.bat at" + $ ...
      
    •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      • CategoryInfo : OperationStopped: (Could not find ... Studio 14.0\vc:String) [], RuntimeException
      • FullyQualifiedErrorId : Could not find Visual Studio vcvarsall.bat atC:\Program Files (x86)\Microsoft Visual Stu
        dio 14.0\vc

    I'll continue investigating

  3. SteveL-MSFT commented on Aug 12, 2016

    @SteveL-MSFT
    MemberAuthor

    Repros on clean Windows machine with start-psbootstrap successfully completing. Nana says Karol Kaczmarek (@KarolKaczmarek) is already investigating related issue

  4. andyleejordan commented on Aug 12, 2016

    @andyleejordan
    Member

    Can we narrow this down to particular OS versions? As it does not repro on AppVeyor.

  5. SteveL-MSFT commented on Aug 12, 2016

    @SteveL-MSFT
    MemberAuthor

    I'm using Win10 Anniversary Update

  6. SteveL-MSFT commented on Aug 13, 2016

    @SteveL-MSFT
    MemberAuthor
  7. bgelens commented on Aug 14, 2016

    @bgelens
    Contributor

    I had the same issues on my Win10 preview build 14901 (Win10 Post AU).
    I also have VS15 Preview 3 installed.
    I went in psbuild.psm1 and updated the Env:VS140COMNTOOLS check to Env:VS150COMNTOOLS. I also had to install Common Tools for Visual C++ 2015 (modify VS install) to make vcvarsall.bat available on my system. Now I'm left with the final issue where CMake doesn't recognize the C++ compiler. Will update when I fix this.

    Update: VS 15 support for CMake is due October with 3.7.0 release. So will be reverting to Visual Studio 2015. https://gitlab.kitware.com/cmake/cmake/milestones/2

    On another note:
    The Start-PSBootstrap function install CMake portable if CMake is not already on the system. When it does this, it adds C:\Program Files(x86)\CMake to the Path but this path does not exist with CMake portable. Instead Cmake will be located in C:\ProgramData\chocolatey\bin

  8. KarolKaczmarek commented on Aug 16, 2016

    @KarolKaczmarek
    Contributor

    Steve Lee (@SteveL-MSFT)
    For vcvarsall to be present you must have Visual Studio with "Common Tools for Visual C++ 2015" feature installed.
    We should also install it in Start-PSBootstrap or at least document it's needed.

    Ben Gelens (@bgelens)
    By "Cmake doesn't recognize the C++ compiler" do you mean error like CMAKE_CXX_COMPILER not set?
    If so, you may need to add parent of cl.exe (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin) to the path.

    Also, good point regarding the cmake.portable. Will send PR for that.

  9. kilasuit commented on Aug 17, 2016

    @kilasuit
    Collaborator

    I was stung by this as well trying to run Start-PSBuild on a fresh Win10 machine

    And it to me this also brings the question of if we are not suggesting to people to have to use the VisualStudio build process then should we remove it being a seemingly hidden requirement (not noted in the building docs) and move to a complete VS free (if possible - not sure as I'm still new to development like this) build process

    If not then we should update the docs to have a simple list of requirements so that anyone could follow along.

    Also the Start-PSBuild requires git installed so I think we should also add a check for this in Start-PSBootstrap too.

  10. kilasuit commented on Aug 17, 2016

    @kilasuit
    Collaborator

    Should have mentioned I'd be happy to work on that documentation once I know what's the minimum requirements as noted above

  11. 8 remaining items

  12. ravindrank commented on Aug 18, 2016

    @ravindrank

    Regarding cmake, the build process start-psbuild adds the incorrect path (c:\program files (x86)\cmake) to path variable. On my Windows 10 1511, Cmake gets installed in c:\program files\cmake (not the x86 pf). Maybe its chocolatey which changed the install path?

    Build fails though with:

    `Execution of { dotnet restore $RestoreArguments } failed with exit code 1
    At D:\Source\Repos\PowerShell\build.psm1:1712 char:13

    •         throw "Execution of {$sb} failed with exit code $LASTEXIT ...
      
    •         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      • CategoryInfo : OperationStopped: (Execution of { ...ith exit code 1:String) [], RuntimeException
      • FullyQualifiedErrorId : Execution of { dotnet restore $RestoreArguments } failed with exit code 1`
  13. KarolKaczmarek commented on Aug 18, 2016

    @KarolKaczmarek
    Contributor

    Keith Hill (@rkeithhill)
    no cmake_cxx_compiler could not be found
    suggests you need to add path to cl.exe added to your PATH.

    The previous error you were getting with nuget paths was just temporary and is fixed now, as you've noticed.

    and while VC++ tools take 3GB, it's still significant improvement comparing with the size of full VS installation.

    Ravindran Keshavan (@ravindrank) I wish there was an easy way to detect what exact path choco installs given component to... that would help get rid of such problems.

    That being said, I believe cmake gets added to the PATH automatically during the installation so we could remove that code - I need to double check it though.

  14. rkeithhill commented on Aug 19, 2016

    @rkeithhill
    Collaborator

    This is the error I find buried in the CMakeError.log for powershell-native:

    The Windows SDK version 8.1 was not found. Install the required version of Windows SDK ...
    

    So it looks like the VC++ build tools don't install everything you need. Although I though Start-PSBootstrap installed the required SDK on Windows? Hmm, looks like it installed the Windows 10 SDK on my Win7 VM. So why building the CompilerIdC.vxproj think it needs the Windows 8.1 SDK?

  15. rkeithhill commented on Aug 20, 2016

    @rkeithhill
    Collaborator

    OK installed the Windows 8.1 SDK on my Windows 7 VM and I get further. Now it fails here:

    image

    Sorry for the images. Hyper-V is not letting me copy to the host OS clipboard.

    The VC++ build tools do allow you to install the 8.1/10 SDK and the ATL/MFC tools. I'm installing the ATL/MFC tooling and will try again.

  16. mirichmo commented on Nov 3, 2016

    @mirichmo
    Member

    Fixed by #2568

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions