Improve WinSDK search mechanism#1935
Conversation
mhammond
left a comment
There was a problem hiding this comment.
This seems reasonable, thanks!
|
Note: This required a conflict resolution and rebase of #1936 , which is about to remove the obsolete _fixup_sdk_dirs() mechanism at all, including the find_platform_sdk_dir() and its changes here and the raising of "Can't find the Windows SDK". See also #1897 . Then the distutils mechanism alone will locate the VC & SDK dirs - which searches and uses the "probably best" vcvarsall.bat -> vcvars64.bat etc. (which then uses the up-to-date MS standards) compatible with python in the normative way. (This should clear up conflicts and mixups of 2 obviously different mechanisms. For the last months at least include & lib dirs of 2 different SDK kits at the same time were seen on compiler command lines on github CI - which resulted from _fixup_sdk_dirs() ) Maybe this removes the initial problem here anyway. |
Found this when building for #1928.
Not sure if anyone else ran into this. I must mention that I have 9 different VStudio versions installed (and each one installed its "own" WinSDK version). At some point I did some cleanup (as there were too many WinSDKs), I don't remember if I did that from Programs and Features or from a VStudio installer (in any case I didn't manually alter the paths or registry keys).
Bottom line is that I have a discrepancy between registry and disk (1st entry returned by registry does not exist on disk) and due to (what I consider) a bug in setup.py, I end up in the following situation:
even if I have valid WinSDK version(s).
Besides the fix, I also extracted registry code in a different function (will be easier to maintain in case MS decides to also release 064bit WinSDK versions), and renamed some variables.
This can be worked around by setting MSSDK_* variables, but it should also work OOTB.