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

How do I get details on how VCPKG_VISUAL_STUDIO_PATH is used? #22068

Closed
thxkiwi opened this issue Dec 17, 2021 · 6 comments
Closed

How do I get details on how VCPKG_VISUAL_STUDIO_PATH is used? #22068

thxkiwi opened this issue Dec 17, 2021 · 6 comments
Assignees
Labels
category:question This issue is a question

Comments

@thxkiwi
Copy link

thxkiwi commented Dec 17, 2021

I have created the discussion #20961

and not got any community or vcpkg team response in two months so I'm trying to contact the vcpkg team directly, here.

The overall issue I have is that I need to control where vcpkg finds the compiler/toolchain to use and am running into issues. If there is work that needs to be done I'm happy to contribute my time to resolving issues but I can find only few references to VCPKG_VISUAL_STUDIO_PATH in the https://github.com/microsoft/vcpkg repo and as such struggling to find how this is used internally and therefore why it complains that the location used does not contain a valid instance of the VS toolchain when location does.

Hoping we can work together to get this working.

@Neumann-A
Copy link
Contributor

https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md#vcpkg_visual_studio_path

the code for the selection itself is in vcpkg-tool.

used does not contain a valid instance

probably you did not install the English language pack.

- [Visual Studio][getting-started:visual-studio] 2015 Update 3 or greater with the English language pack

@thxkiwi
Copy link
Author

thxkiwi commented Dec 17, 2021

@Neumann-A are you or any of the team able to say specifically what it is that vcpkg looks for to determine whether VCPKG_VISUAL_STUDIO_PATH is valid in the eyes of vcpkg?

https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md#vcpkg_visual_studio_path

the code for the selection itself is in vcpkg-tool.

I'll start grokking... but again if anyone can answer this question directly would be greatly appreciated since it isn't called out in the standard vcpkg documentation.

used does not contain a valid instance

probably you did not install the English language pack.

- [Visual Studio][getting-started:visual-studio] 2015 Update 3 or greater with the English language pack

I thought that by default the VS installer(s) select the language based on the locale of the machine...

From https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio

--addProductLang Optional: During an install or modify command, this repeatable parameter specifies the UI language packs that should be installed with the product. If not present, the installation uses the language pack that corresponds to the machine locale. For more information, see the List of language locales section on this page.

When I created the offline installer via --layout it contains all locales and language packs. If the validity of the VS instance is based on language pack then are you able to say exactly how to install Visual Studio to provide that specific VS component or VS workflow needed if the default option (based on the machine locale, which is en-US [see below]) is insufficient?

PS C:\> get-winsystemlocale

LCID             Name             DisplayName
----             ----             -----------
1033             en-US            English (United States)

@Neumann-A
Copy link
Contributor

@Neumann-A
Copy link
Contributor

Try setting VS160COMNTOOLS in your environment if it is not set and vswhere is not installed at const Path vswhere_exe = program_files_32_bit / "Microsoft Visual Studio" / "Installer" / "vswhere.exe";. From your example it should probably be pointing to: D:\Program Files\Microsoft Visual Studio\2019\BuildTools\Common7\Tools
and make sure you have

                const auto cl_exe = path_root / "VC" / "bin" / "cl.exe";
                const auto vcvarsall_bat = path_root / "VC" / "vcvarsall.bat";

dumpbin and some other sub folders are also required further down the road but this at least should get you some instances being detected.

@JackBoosY
Copy link
Contributor

Please note that variables like VCPKG_VISUAL_STUDIO_PATH are read-only, and modifications to them in the triplet file or portfile.cmake will not take effect.
As @Neumann-A said, VCPKG_VISUAL_STUDIO_PATH is got according to vswhere.

@JackBoosY JackBoosY added the category:question This issue is a question label Dec 20, 2021
@JackBoosY
Copy link
Contributor

We hope your question was answered to your satisfaction; if it wasn't, you can reopen with more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants