-
Notifications
You must be signed in to change notification settings - Fork 195
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
Update Visual Studio detection scripts #1008
Comments
Quick recap:
In general, VS2017 and all newer versions should be detected with the vswhere tool, since all of these install vswhere as part of their setup process. It's not clear to me why VS2017 is explicitly included in the script this way. I have only VS2019 installed, and it works fine for me. I'd be interested to hear why a fallback was desired at all for VS2017. If somebody who can merge PRs looks into this, I'd appreciate this being looked at as well: #796. |
I can't recall exactly, but vswhere may have come as a separate download or service pack at some stage, so there may have been a transition. As I understand it, the latest stuff seems to just work. Are you finding a need for additional fallbacks? |
This came up after troubleshooting with a user from the Haxe discord who wasn't able to get the compilation to work. I believe they had installed vs2019 via winget: winget install --id=Microsoft.VisualStudio.2019.BuildTools -e However, HXCPP was giving errors about how it it wasn't able to locate vs2017. |
I don't have a problem with fallbacks - especially with a well defined used case - so if they fix things then good. |
Looks like the answer to that is no unfortunately, for now at least: microsoft/vswhere#222. Here is the wiki page with the available installation methods: Perhaps a solution would be to add proper instructions on how to install a minimum working msvc version somewhere in the manual. If it is clear to users that they need to have vswhere so MSVC can be located, then it's less of an issue. |
Although, it looks like vswhere doesn't find build tools by default, unless an extra flag is added: |
nvm, acording to #1010, it works fine as long as vswhere is installed. |
Ok, so apparently the winget package does already exist: winget install -e --id Microsoft.VisualStudio.Locator See: https://winget.run/pkg/Microsoft/VisualStudio.Locator I assumed it wasn't because it wasn't mentioned in the documentation. In that case, we might just want to update the docs to mention that vswhere is required, and also update the error message here: |
It looks like the scripts for detecting MSVC installations are out of date, because they have specific checks for VS2017 but not for VS2019 or VS2022. We should update them so they work for newer versions.
See:
https://github.com/HaxeFoundation/hxcpp/blob/master/toolchain/msvc-setup.bat
https://github.com/HaxeFoundation/hxcpp/blob/master/toolchain/msvc64-setup.bat
The text was updated successfully, but these errors were encountered: