Skip to content

Guests can build swift-sprite, swift-png and DynamicFonts - #42

Merged
colemancda merged 3 commits into
masterfrom
feature/guest-sprites-prep
Dec 3, 2026
Merged

colemancda merged 3 commits into
masterfrom
feature/guest-sprites-prep

Conversation

@colemancda

@colemancda colemancda commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

The first step toward Packages/Games and DynamicSprite (Documentation/Contracts/Sprites.md).

Changes

  • Scripts/guest.py adds SystemZlib to GUEST_DISABLED_TRAITS. swift-sprite asks for swift-png's default traits, and that one links the system zlib, which a guest can't. With it off, swift-png inflates with swift-zlib, in Swift, and its CSystemZlib target drops out of the build.
  • Scripts/test_guest_traits.py tests that a dependent asking for swift-png's defaults still gets neither the trait nor CSystemZlib.
  • Documentation/Contracts/Fonts.md item 5 now records that DynamicFonts builds as Embedded Swift unchanged.

How it was checked
I built a throwaway app product, not committed, in a Packages/Games package. It depends on AppRuntime (DynamicRuntime, DynamicSwiftUI, DynamicGraphics, DynamicFonts), swift-sprite (SpriteGraph, SpritePhysics) and swift-png. guest.py slice --target linux-arm64 ran in the swift:6.4 image.

python3 -m unittest discover -s Scripts -p 'test_*.py' passes.

Wasm
guest.py slice --target wasm was also run in the same image, with swift.org's Embedded wasm SDK for 6.4.2 mounted in.

  • The probe produced App.wasm.
  • DynamicFonts on its own compiled and linked. It stops only at "missing export rt_main", since it's a library, not an app.
  • Xcode's Swift 6.4.2 can't build wasm slices: it rejects swift.org-built modules, the SDK's stdlib included, as "created by a different version of the compiler". Wasm slices need a swift.org toolchain or that image.

@colemancda
colemancda merged commit 2581cf2 into master Dec 3, 2026
3 checks passed
@colemancda
colemancda deleted the feature/guest-sprites-prep branch December 3, 2026 22:48
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