Open kylecmarshall opened 1 year ago
I solved the issue by uninstalling Visual Studio 2022 Build Tools.
The issue is caused when vcpkg is trying to determine the preferred instance of visual studio to use. It uses a comparator preferred_first_comparator
:
Visual Studio 2022 Community and Visual Studio 2022 Build Tools are equivalent under this comparator which causes SortedVector
to remove one of them in its uniqueify
:
Visual Studio 2022 Community was the unlucky one and it got erased from the list of possible instances before further checking even began.
So a duct tape solution is to just uninstall Build Tools so that it doesn't show up in vswhere. This allows VS 2022 Community to stay in the list of possible instances. A better solution would be to update preferred_first_comparator
to split the equivalence class between Build Tools and VS that have the exact same version number.
I thought about this yesterday and another solution might be to use a different sorted vector that keeps equivalent elements.
Thanks for your suggestion, we will think about ways to fix this issue.
So a duct tape solution is to just uninstall Build Tools so that it doesn't show up in vswhere. This allows VS 2022 Community to stay in the list of possible instances. A better solution would be to update
preferred_first_comparator
to split the equivalence class between Build Tools and VS that have the exact same version number.
Oh my god thank you, wasted hours on this issue and this is the only thing that worked for me!
This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 180 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.
Just hit "Could not locate a complete Visual Studio instance" issue after updating to "Visual Studio Community 2022 17.10.0". Clearly doing such update was mistake since now cannot build project, due to this peculiar error from vcpkg.
1>EXEC : error : in triplet x64-windows: Unable to find a valid Visual Studio instance
1>Could not locate a complete Visual Studio instance
1>The following paths were examined for Visual Studio instances:
1> C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary/Build\vcvarsall.bat
Seeming somebody else hit same (https://developercommunity.visualstudio.com/t/VCPKG-fails-with-VS-v17100/10663893?sort=newest), and Microsoft support unhelpfully just pointed into vcpkg.
(trying to revert back to previous visual studio version which, was not breaking vcpkg)
Running into this with VS 17.10.5. It would be nice if this could be fixed, as it's quite a pain for me working on projects that usee vcpkg.
This embarrassing open issue is one year old! God save us all!
So a duct tape solution is to just uninstall Build Tools so that it doesn't show up in vswhere. This allows VS 2022 Community to stay in the list of possible instances. A better solution would be to update
preferred_first_comparator
to split the equivalence class between Build Tools and VS that have the exact same version number.
This workaround doesn't work for me, I removed the build tools and rebooted but yet am still unable to compile.
This really needs to be fixed, we can't be telling people to uninstall build tools to solve their problems.
This is NOT sustainable!
Describe the bug VS 2022 Community doesn't work with the included vcpkg. Both the included vcpkg and any release of vcpkg I tried could not locate Visual Studio.
Environment
To Reproduce Steps to reproduce the behavior:
Expected behavior Successful build of directxtk and the project
Failure logs
Additional context vcpkg.json
& 'C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe' -all -prerelease -legacy -products * -format xml