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

Does not recognize VS2022 #2

Closed
jeffrson opened this issue May 6, 2022 · 7 comments
Closed

Does not recognize VS2022 #2

jeffrson opened this issue May 6, 2022 · 7 comments

Comments

@jeffrson
Copy link

jeffrson commented May 6, 2022

Build check throws an error 'Unable to detect compiler type' with Visual Studio 2022 installed.

msbuild.exe can be found on my system as

C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe

(that's on Windows 10 x64 - so it's not any longer located in "Program Files(x86)").

@jeffrson
Copy link
Author

jeffrson commented May 6, 2022

Looking at current master that's not true. Instead it appears to be cpu-features, that depends on buildcheck 0.0.3.

@jeffrson
Copy link
Author

jeffrson commented Dec 20, 2022

Now it fails for VS 17.4 indeed.

Apparently, Microsoft delivers Windows 10 SDK as package "Microsoft.VisualStudio.Component.Windows10SDK" without a version, but for Windows 11 there is "Microsoft.VisualStudio.Component.Windows11SDK.22000" (for example).

OTOH, in registry it is stored as Windows 10 SDK:

image

Furthermore, when I update the SDK to the latest version, there is

image

@mscdex
Copy link
Owner

mscdex commented Apr 8, 2023

Closing this as VS2022 support should be working and we now have CI verifying that as well.

@mscdex mscdex closed this as completed Apr 8, 2023
@jeffrson
Copy link
Author

Unfortunately this is not really true - even if CI is verifying (which prerequisites is it using?).

It still fails to detect VS2022 with only Windows 11 SDK (current default SDK 10.0.22000.0, as well as 10.0.22621.0). It only works if manually adding some Windows 10 SDK.

That's actually the same I described above. So nothing changed.

@mscdex
Copy link
Owner

mscdex commented Apr 11, 2023

I was under the impression that VS2022 detection was the problem, which is covered by the windows-2022 Github Actions image.

For Windows 11 SDK detection, can you try applying this patch and see if that helps?:

diff --git a/lib/findvs.js b/lib/findvs.js
index ea87e14..d9794d7 100644
--- a/lib/findvs.js
+++ b/lib/findvs.js
@@ -156,8 +156,8 @@ function findModernVS() {
               const sdkVer = parseInt(m[2], 10);
               if (!isFinite(sdkVer) || sdkVer < 0)
                 continue;
-              fullVersion = `${sdk}.0.${sdkVer}.0`;
-              version = `${sdk}.0`;
+              fullVersion = `10.0.${sdkVer}.0`;
+              version = '10.0';
               break;
             }
           }

@mscdex mscdex reopened this Apr 11, 2023
@jeffrson
Copy link
Author

I'm sorry if it was misleading - the error message just says "Unable to detect compiler type".

And yes, this little patch helps indeed!

@mscdex
Copy link
Owner

mscdex commented Apr 11, 2023

Fixed in 19d7fba. Thanks for the verification.

@mscdex mscdex closed this as completed Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants