-
Notifications
You must be signed in to change notification settings - Fork 118
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
Make NIOTS a conditional target dependency #544
base: main
Are you sure you want to change the base?
Conversation
ac54096
to
3c8af21
Compare
3c8af21
to
0051662
Compare
I assume the underlying bug is this: https://bugs.swift.org/browse/SR-15358
I wonder if the better place to fix this would be in NIOTS directly? @Lukasa, WDYT? |
Actually, they are not all protected currently, but this patch adds those conditions. The main |
Yeah, I'm inclined to fix NIOTS so that it doesn't bring in Foundation on non-Darwin platforms, and then only merge the parts of this that conditionalise the dependency. I've never felt good about the |
If we want to add |
I'm a bit happier with it over there as that module changes less than this one. |
I agree that having dual Package.swift files is unfortunate. I had to do it recently with another project in order to support DocC. You never feel good about it. That said, NIO is planning to drop Swift 5.2 once 5.6 launches, meaning this package must do the same, and 5.6 has already branched so hopefully it won't be too long. |
I suppose that raises another option, which is that we could just wait until we do that drop and then make the change in NIOTS once and for all. |
Also remove an unneeded NIOFoundationCompat target dependency (it's only used by tests, not the AHC library itself).
NIOTS also has an unconditional target dependency on NIOFoundationCompat. In the WebURL port, I found that these were still pulling in Foundation, even though nothing actually used Foundation.
Since conditional target dependencies are a Swift 5.3 feature, this requires adding a 5.3 variant of Package.swift.