Skip to content

Link FoundationEssentials instead of Foundation - #258

Merged
kylebrowning merged 1 commit into
mainfrom
foundation-essentials
Aug 14, 2026
Merged

Link FoundationEssentials instead of Foundation#258
kylebrowning merged 1 commit into
mainfrom
foundation-essentials

Conversation

@kylebrowning

Copy link
Copy Markdown
Owner

APNS and APNSCore were pulling in full Foundation through two paths: NIOFoundationCompat, imported by the JSON coders only for readData/writeData, and one unshimmed import struct Foundation.Date in APNSLiveActivityDismissalDate.

Adds the foundation-linking check to CI. APNSURLSession and APNSTestServer are excluded — they need URLSession, JSONSerialization and NSNumber, none of which exist in FoundationEssentials.

Verified in a swift:noble container. Before, the check binary linked libFoundation.so, libFoundationInternationalization.so and lib_FoundationICU.so; after, only libFoundationEssentials.so. 154 tests pass.

The APNS and APNSCore products pulled in full Foundation through two
paths: NIOFoundationCompat, imported by the JSON coders only for
readData/writeData, and an unshimmed `import struct Foundation.Date` in
APNSLiveActivityDismissalDate that the rest of APNSCore already guards.

Replace the former with readBytes/writeBytes and shim the latter with
canImport(FoundationEssentials).

APNSURLSession and APNSTestServer genuinely need full Foundation for
URLSession, JSONSerialization and NSNumber, so the new CI check excludes
them and covers APNS and APNSCore.

Verified in a swift:noble container: beforehand the check binary linked
libFoundation.so, libFoundationInternationalization.so and
lib_FoundationICU.so; afterwards it links only libFoundationEssentials.so.
@kylebrowning
kylebrowning merged commit ff8a4fc into main Aug 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant