New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build.bat should locate msbuild.exe rather than vcvarsall.bat #74872
Comments
Due to how installation of Visual Studio 2017 has changed, it's very possible to end up with a valid install of the build tools without vcvarsall.bat being valid. We only require MSBuild.exe to build, so we should find that tool and invoke it, rather than trying to configure the entire environment. |
Ned - this has been merged into 3.6 branch and the buildbots look good. Feel free to move the NEWS item around and/or cherrypick into 3.6.2 at your leisure. |
This change causes build failures when VS2017 is installed without the C++ tooling as it finds MSBuild belonging to VS2017 but it can't build using it. Microsoft recommends using this tool https://github.com/microsoft/vswhere to find and set up the paths, it also works with VS2015. |
You're going to get build failures without the C++ tooling anyway, and msbuild should find previous installs that are compatible. What is your system setup that causes this failure when you expect success? |
Currently I have VS2017 installed without C++ tooling for .NET development. The C++ tooling breaks other projects I'm working on. I have VS2015 Community update 3 installed with C++ tooling and the latest compatible Windows SDK. Before this patch everything builds as expected using PCBuild\build.bat -e. After this patch it fails instantly with Using "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\\MSBuild\15.0\Bin\msbuild.exe" (found in the Visual Studio 2017 registry) C:\code\cpython>"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\\MSBuild\15.0\Bin\msbuild.exe" "C:\code\cpython\PCbuild\pcbuild.proj" /t:Build /m /nologo /v:m /p:Configuration=Release /p:Platform=Win32 /p:IncludeExternals=true /p:IncludeSSL=true /p:IncludeTkinter=true /p:UseTestMarker= /p:GIT="C:\Program Files\Git\cmd\git.exe" Commenting out the following lines from find_msbuild.bat and everything is back to working @Rem VS 2017 sets exactly one install as the "main" install, so we may find MSBuild in there. |
I suspect that should be filed as a bug against VS 2017 - I'll do that when I get to work on Monday. Our workaround should be to check for that targets file and keep searching if it's not found. Your best workaround is to start the build from the VS 2015 developer command prompt, which will have the right MSBuild on PATH and will bypass the search. |
I don't believe that this is a bug in Visual Studio as MSBuild is used for .NET projects as well it should be available even without the C++ tooling installed. Checking for the targets file seems like a workable solution. |
The bug is MSBuild 15.0 should be able to locate earlier versions of VC, even if you haven't installed it for VS 2017. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: