-
Notifications
You must be signed in to change notification settings - Fork 656
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
Use the new Android overlay in the tests and update some Bionic declarations #3009
Conversation
…rations Motivation: Get this repo building again for Android with NDK 27 Modifications: - Update some networking declarations for newly added nullability annotations - Import the new Android overlay instead in some tests - Add two force-unwraps on all platforms, that are needed for Android Result: This repo and its tests build for Android again
@@ -124,12 +124,20 @@ private let sysWritev = sysWritev_wrapper | |||
#elseif !os(Windows) | |||
private let sysWritev: @convention(c) (Int32, UnsafePointer<iovec>?, CInt) -> CLong = writev | |||
#endif | |||
#if !os(Windows) | |||
#if canImport(Android) | |||
private let sysRecvMsg: @convention(c) (CInt, UnsafeMutablePointer<msghdr>, CInt) -> ssize_t = recvmsg |
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.
These nullability annotations were added with NDK 27 this summer, so adapt these networking APIs for that.
#elseif canImport(Bionic) | ||
import Bionic | ||
#elseif canImport(Android) | ||
import Android |
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.
As discussed a couple months ago, the compiler started requiring different imports after the Foundation rewrite this summer.
The two failing linux CI jobs with nightly-main appear unrelated. |
Thanks for the quick review. 😃 |
I added this changed function call for Android in #2660 earlier this year, because of [an incorrect Bionic function signature as explained recently](#3009 (comment)), but now that it has been worked around through a new API note as mentioned there, this change is no longer needed. I simply did not notice this earlier because it still compiles and merely gives a warning, which removing this call now silences.
Motivation:
Get this repo building again for Android with NDK 27
Modifications:
Result:
This repo and its tests build for Android again
I've been using these patches on my Android CI and natively on Android for a couple months now. I didn't bother keeping this patch building for Android with Swift 5 anymore, as my Android CI no longer tests Swift 5.
I built this pull and ran the tests on linux x86_64 to make sure there was no regression.