Add canImport(Android) alongside Bionic in remaining libc import sites#3584
Open
networkextension wants to merge 1 commit intoapple:mainfrom
Open
Add canImport(Android) alongside Bionic in remaining libc import sites#3584networkextension wants to merge 1 commit intoapple:mainfrom
networkextension wants to merge 1 commit intoapple:mainfrom
Conversation
Swift 6.3 Android SDK (finagolfin/swift-android-sdk) ships the libc
shim as the `Android` module only; the `Bionic` module was removed.
Files that had only `#elseif canImport(Bionic)` in their top-level
`#if` chain hit `#error("… unable to identify your C library.")`.
Add `#elseif canImport(Android)` before each `#elseif canImport(Bionic)`
in the 20 remaining top-level import sites, and add `|| canImport(Android)`
to the 44 inline `canImport(Glibc) || canImport(Musl) || canImport(Bionic)`
boolean guards. Both branches are kept so older SDKs that still ship
Bionic continue to work.
FileDescriptor+Syscalls.swift and Syscall.swift Android branches also
import CNIOLinux because those files use CNIOLinux_O_TMPFILE,
CNIOLinux_RENAME_NOREPLACE, etc. inside the newly-gated blocks.
https://claude.ai/code/session_01Gmec6R8WK6XsSSwecZ9AAm
Contributor
|
You sure about this? Builds fine on my CI, including passing most tests. |
Contributor
|
@Lukasa, I suspect this is AI slop... |
Author
|
I'm porting iOS/Mac app which use Swift-NIO, you can view my github profile. |
Contributor
|
OK, whatever AI, which you yourself admit to using in your profile, you employ doesn't work, as my linked Android CI runs show. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Swift 6.3 Android SDK (finagolfin/swift-android-sdk) ships the libc shim as the
Androidmodule only; theBionicmodule was removed. Files that had only#elseif canImport(Bionic)in their top-level#ifchain hit#error("… unable to identify your C library.").Add
#elseif canImport(Android)before each#elseif canImport(Bionic)in the 20 remaining top-level import sites, and add|| canImport(Android)to the 44 inlinecanImport(Glibc) || canImport(Musl) || canImport(Bionic)boolean guards. Both branches are kept so older SDKs that still ship Bionic continue to work.FileDescriptor+Syscalls.swift and Syscall.swift Android branches also import CNIOLinux because those files use CNIOLinux_O_TMPFILE, CNIOLinux_RENAME_NOREPLACE, etc. inside the newly-gated blocks.
https://claude.ai/code/session_01Gmec6R8WK6XsSSwecZ9AAm
Support Android Bionic
Motivation:
Porting Swift-NIO project to Android Bionic
Modifications:
-#if canImport(Glibc) || canImport(Musl) || canImport(Bionic)
+#if canImport(Glibc) || canImport(Musl) || canImport(Android) || canImport(Bionic)
Result:
Swift-NIO project porting to Android Bionic success
@finagolfin