Skip to content
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

Windows: Use vswhere to locate latest Visual C++ installation #10805

Closed
wants to merge 1 commit into from

Conversation

gjasny
Copy link
Contributor

@gjasny gjasny commented Feb 17, 2020

Starting with Visual Studio 15.2 vswhere.exe is installed into
%ProgramFiles(x86)%\Microsoft Visual Studio\Installer.

We locate the latest non-prerelease version which has the
Desktop development with C++ workload installed.

Closes: #10772

@gjasny
Copy link
Contributor Author

gjasny commented Feb 17, 2020

When nothing matches vswhere does not error out but happily returns nothing. I need to run some more tests today and refine the query and error handling

@gjasny
Copy link
Contributor Author

gjasny commented Feb 17, 2020

The build error looks unrelated.

@aiuto aiuto added the area-Windows Windows-specific issues and feature requests label Feb 18, 2020
@meteorcloudy meteorcloudy requested review from meteorcloudy and removed request for laszlocsomor March 6, 2020 11:42
@meteorcloudy
Copy link
Member

@gjasny Thanks for the contribution!
This CL looks good, should we wait for #10807 to be merged first?

Starting with Visual Studio 15.2 vswhere.exe is installed into
`%ProgramFiles(x86)%\Microsoft Visual Studio\Installer`.

We locate the latest non-prerelease version which has the
C++ x64/x86 build tools installed.

Closes: bazelbuild#10772
@gjasny
Copy link
Contributor Author

gjasny commented Mar 7, 2020

This CL looks good, should we wait for #10807 to be merged first?

I'd merge this one before. The environment variable lookup problems do not influence this PR (more than before). I guess most users have their "Program Files" folder on the C-drive anyways.

Copy link
Member

@meteorcloudy meteorcloudy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@bazel-io bazel-io closed this in ff46732 Mar 10, 2020
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests cla: yes team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Visual Studio 2019 should be preferred over 2017
5 participants