-
Notifications
You must be signed in to change notification settings - Fork 10.5k
WinSDK: extract several submodules #33929
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
Conversation
@swift-ci please smoke test |
@egorzhdan this is an excellent idea, especially if we can get it to work. I had accidentally done some of this with the latest rebramch, and it seems that we have a bunch of module fixes that enable a better set of submodules. Im not particularly keen on referring to the shared headers. I would rather keep the references to just the The BTW, I'll try to see if I have a change still laying around - I had split WinSock into WS and WS2. The CommDlg - should that be a separate module or should it be part of commctrl? |
Okay. Do the shared headers belong in some separate module, other than
Hmm, agreed, I'll make the changes here.
Sure, I'll send a new PR with these modules only. BTW, they are grouped together under Internationalization in MSDN, so I'll probably merge them.
The MSDN lists them in separate sections (Windows Controls for |
They are shared, I don't think that we want more modulemaps. We should let them be owned by some um module as a result of inclusion.
Either is fine by me. It seems Microsoft splits rheum, under a UI module, which corresponds with your idea of a larger module. But, that seems good to get merged. |
Leaving |
Yeah, I think that there will need to be one gigantic module that has basically windows.h, but whatever we can shear off into modules, we should (especially at the library boundaries) as per MSDN. |
45db3db
to
9224c75
Compare
Hmm, really? Winver was converted into the winapi contract? Cool. I think that we should find a better name than misc, since it really is the core of the WinSDK. Can we put windows.h without a sub module into winsdk? |
I think |
713ebbd
to
072e896
Compare
I think that we should extract the meaningful modules no matter what we end up with. There is no reason to have a single module that contains everything. This should both help IDE integration in the future and should improve the usability of the modules. So I think that the work that you are doing here is valuable. As to Windows.h being left with just orphan headers - that actually sounds like a pretty good state to be in. I don't think that it should prevent the SDK overlay from providing the declarations since it overlays the module. But we should test that to verify. |
@egorzhdan would you mind putting up a PR for the version API contract part of the change? I think that we should get that merged as well. |
Okay, extracted in #34085 |
I've tried moving
I guess, submodules are not allowed to depend on top level modules? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the WinNT
module, though not great, might be okay, but the Misc
module is not really correct.
@@ -217,6 +217,11 @@ module WinSDK [system] { | |||
link "WinMM.Lib" | |||
} | |||
|
|||
module Misc { | |||
header "Windows.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really is incorrect. Windows.h
is an umbrella header, not a miscellaneous module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, I don't think it's possible to make it an umbrella header without changes to SourceKit or Clang, so I'll just drop this commit.
@swift-ci please test |
Currently
WinSDK.WinSock2
includes several headers which aren't specific to sockets, for example,windef.h
which includes typedefs forDWORD
,HKEY
, etc.This PR extracts some of these headers into separate
WinSDK
submodules, making it cleaner and easier to navigate.It also reduces the size of the generated Swift interface for
WinSDK.WinSock2
which used to exceed 2.7 MB.