Skip to content

[CPF] Use pure-Swift CG geometry on WASI/Linux/Android - #23

Merged
gn-adin-b merged 4 commits into
mainfrom
adin/foundation-essentials-polyfill-cleanup
Jul 29, 2026
Merged

[CPF] Use pure-Swift CG geometry on WASI/Linux/Android#23
gn-adin-b merged 4 commits into
mainfrom
adin/foundation-essentials-polyfill-cleanup

Conversation

@gn-adin-b

Copy link
Copy Markdown

What is the goal?

Stop importing full Foundation for CG geometry types on WASI/Linux/Android — that import reintroduces the ICU/Foundation payload the FoundationEssentials migration is trying to remove from the Wasm link closure.

How is it being implemented?

  • Revert the CGFloat/CGPoint/CGSize/CGRect aliasing to Foundation's types on Linux/WASI/Android; use the existing pure-Swift structs instead (the same fallback already used on other platforms without CoreGraphics).
  • Use canImport(FoundationEssentials) uniformly for the import instead of special-casing Linux/WASI/Android to full Foundation.
  • Remove testGeometryTypesMatchFoundation, which asserted bit-for-bit equivalence with Foundation's geometry types and no longer holds now that these are distinct local types.

Testing

  • swift build (native macOS)
  • swift test --filter PolyfillTests (native macOS)

@gn-adin-b
gn-adin-b merged commit 29f276d into main Jul 29, 2026
3 checks passed
@gn-adin-b
gn-adin-b deleted the adin/foundation-essentials-polyfill-cleanup branch July 29, 2026 05:46
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.

2 participants