Closed thxkiwi closed 2 years ago
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. https://github.com/microsoft/vcpkg/blob/50fd3d9957195575849a49fa591e645f1d8e7156/README.md?plain=1#L70
@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. https://github.com/microsoft/vcpkg/blob/50fd3d9957195575849a49fa591e645f1d8e7156/README.md?plain=1#L70
I thought that by default the VS installer(s) select the language based on the locale of the machine...
--addProductLangWhen 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)
The complete selection code is in: https://github.com/microsoft/vcpkg-tool/blob/main/src/vcpkg/visualstudio.cpp
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.
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
.
We hope your question was answered to your satisfaction; if it wasn't, you can reopen with more info.
I have created the discussion https://github.com/microsoft/vcpkg/discussions/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.