Skip to content

Use swift-embedded-foundation instead of Foundation shims#25

Merged
colemancda merged 10 commits into
masterfrom
feature/embedded
Jul 19, 2026
Merged

Use swift-embedded-foundation instead of Foundation shims#25
colemancda merged 10 commits into
masterfrom
feature/embedded

Conversation

@colemancda

Copy link
Copy Markdown
Member

Summary

Replaces the hand-rolled Foundation shims (Data, UUID, Date, Decimal, URL, ~700 lines) with the swift-embedded-foundation package for Foundation-free (Embedded Swift) builds.

  • Package.swift adds the FoundationEmbedded dependency behind a SWIFT_EMBEDDED=1 environment gate, since its deployment-target minimums are higher than CoreModel's and regular builds use Foundation/FoundationEssentials anyway
  • The five shim files are deleted and replaced by a single FoundationShims.swift that re-exports the FoundationEmbedded types via public typealias under #if !canImport(FoundationEssentials) && !canImport(Foundation)
  • ObjectID.swift and Predicate/Expression.swift gain #elseif canImport(FoundationEmbedded) import branches, required because Embedded Swift needs a per-file import for cross-module member access
  • The Embedded WebAssembly CI job now sets SWIFT_EMBEDDED=1

Testing

  • swift build and swift test on macOS: 22/22 tests pass
  • Embedded WebAssembly build (swift-6.3.3-RELEASE_wasm-embedded SDK) with SWIFT_EMBEDDED=1 SWIFTPM_ENABLE_MACROS=0, debug and release: builds clean

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: Swift

Swift / code-coverage/llvm-cov

The overall coverage remains at 96%, unchanged from the master branch.


Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@colemancda
colemancda merged commit 935299d into master Jul 19, 2026
32 checks passed
@colemancda
colemancda deleted the feature/embedded branch July 19, 2026 21:50
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