Skip to content

NIOIMAPCore: import the Android overlay module instead of Bionic#829

Open
odrobnik wants to merge 1 commit into
apple:mainfrom
odrobnik:use-android-libc-module
Open

NIOIMAPCore: import the Android overlay module instead of Bionic#829
odrobnik wants to merge 1 commit into
apple:mainfrom
odrobnik:use-android-libc-module

Conversation

@odrobnik

@odrobnik odrobnik commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Motivation

#826 added a canImport(Bionic) / import Bionic arm to NIOIMAPCore's per-file libc-import guards so the module builds for Android. This follow-up switches that arm to the Android umbrella module.

On the Swift Android SDK, Android re-exports Bionic and layers the Swift overlay on top, so it's the more complete/idiomatic libc surface to import. Bionic is effectively a subset.

Modifications

In the 17 NIOIMAPCore files that gained a Bionic arm, replace canImport(Bionic)/import Bionic (and the import func Bionic.isalnum/isalpha in UInt8+ParseTypeMembership.swift) with the Android equivalents.

Result

No functional change — both modules resolve the libc symbols used here (isalnum/isalpha); NIOIMAPCore still builds for Android. Verified the whole module cross-compiles for Android with import Android (swift build --target NIOIMAPCore via skiptools/swift-android-action).

(Note: swift-nio itself currently uses canImport(Bionic); happy to close this if you'd rather keep nio-imap consistent with that — but flagging that Android is the fuller overlay.)

@odrobnik

odrobnik commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

Android build verification (isolated swift build --target NIOIMAPCore for Android via skiptools/swift-android-action, Swift 6.3.2): green run → https://github.com/odrobnik/swift-nio-imap/actions/runs/26834333005 — confirms import Android / import func Android.isalnum resolve on the Swift Android SDK.

@odrobnik

odrobnik commented Jun 2, 2026

Copy link
Copy Markdown
Contributor Author

@Lukasa @danieleggert sorry guys for another such PR. Bionic is actually a sub-set of Android so it is preferred nowadays to use Android instead. This PR rectifies the mistake I made in the PR #826 which you had already merged.

@danieleggert danieleggert added the semver/none No version bump required. label Jun 2, 2026
@danieleggert

Copy link
Copy Markdown
Collaborator

@odrobnik There’s a CI runner for Android now. If you fix the format failures and push those, we can re-run the PR checks.

apple#826 added a `canImport(Bionic)` / `import Bionic` arm to NIOIMAPCore's
per-file libc-import guards. Switch it to the `Android` umbrella module,
which re-exports Bionic plus the Swift overlay, so the import is the more
complete/idiomatic libc surface on the Swift Android SDK. No functional
change — both resolve the libc symbols (isalnum/isalpha) used here.
@odrobnik odrobnik force-pushed the use-android-libc-module branch from 85b8e7e to bdb0c5c Compare June 12, 2026 14:33
@odrobnik

Copy link
Copy Markdown
Contributor Author

@danieleggert thanks! Rebased onto main (to pick up the Android CI from #831) and force-pushed — the workflows are now sitting in action_required, ready for your approval.

One note on the format check: it wasn't actually a swift-format violation. Every Soundness / Format check run failed at docker pull swift:6.2-noble (registry-1.docker.io … context deadline exceeded), so swift-format never ran. I linted all 17 changed NIOIMAPCore files locally against the repo's .swift-format and they're clean (semver/none is set as well). So this should just need a re-run whenever you get a chance 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants