-
Notifications
You must be signed in to change notification settings - Fork 10.5k
PrivateLibcExtras: Port to Windows #20962
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
@@ -15,10 +15,133 @@ import SwiftPrivate | |||
import Darwin | |||
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku) | |||
import Glibc | |||
#elseif os(Windows) | |||
import MSVCRT | |||
import WinSDK | |||
#endif |
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.
Wouldn't it make most sense to structure this like:
#if canImport(Darwin)
import Darwin
#elseif os(Windows)
import MSVCRT
import WinSDK
#elseif canImport(Glibc)
import Glibc
#endif
Then things work automatically for other POSIX platforms which probably use Glibc (NetBSD, OpenBSD, etc.?) without needing to explicitly update the list every time someone adds a new OS to Swift.
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 is why I had proposed having a C
module which hides this mess. In any case, I suppose that I can change that, but this pattern is prevalent through out the code base. I think it makes sense for someone to go through and catch them all later.
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.
We've talked about such a module before and the primary problem is what to name it. :-) I think there'd be support on -evolution.
64c4a01
to
b2dd971
Compare
@swift-ci please test |
Build failed |
Build failed |
b2dd971
to
7e1665d
Compare
@swift-ci please test |
Build failed |
Build failed |
Add NamedPipe API Set for LibcExtras.
Enable the libc extras to be built for Windows. This is a dependency for StdlibUnittests.
7e1665d
to
d70911e
Compare
@swift-ci please test |
@jakepetroules - okay, I think that this is good now; it can actually spawn the child and do the appropriate setup in my local testing, the rest of the problem now is in StdlibUnittest. Could you PTAK? |
Build failed |
Build failed |
@jrose-apple - anyone else that should take a look at this? |
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.