Allow static linking by removing explicit type: .dynamic#13
Open
tadg-paul wants to merge 1 commit into
Open
Conversation
tadg-paul
added a commit
to tadg-paul/yapper
that referenced
this pull request
Apr 4, 2026
Switch to forked MisakiSwift (tigger04/MisakiSwift, branch remove-dynamic-type) which removes the explicit type: .dynamic declaration. This allows static linking, eliminating all dynamic framework dependencies and fixing the segfault when running the binary outside Xcode's runtime environment. Also fixes String(format: "%s") crash in VoicesCommand — Swift requires %@ not %s for String arguments. Upstream PR submitted: mlalma/MisakiSwift#13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Body
Hi - first of all I wanted to thank you for MisakiSwift and KokoroSwift.
I feel strongly about TTS as a technology that gives a real meaningful benefit to people with disability (I may have a selfish interest, as one of those people myself), but I also feel strongly about such technologies being open source and not behind commercial licenses or paywalls. Your work has been a huge contribution to the ecosystem, and I really appreciate it.
In that spirit, MisakiSwift and KokoroSwift have been invaluable - MisakiSwift as a dependency, and KokoroSwift as an architectural reference for building my own inference pipeline. I hope you'll take the latter as the compliment it's intended as, rather than any attempt to compete - the goal is to build on your work, not to duplicate it.
I'm building yapper, a CLI tool and embeddable Swift library for Kokoro TTS on Apple Silicon. Yapper uses MisakiSwift for G2P and implements its own inference pipeline on MLX Swift (referenced from KokoroSwift's architecture).
The issue
MisakiSwift's
Package.swiftdeclarestype: .dynamic:This forces all downstream consumers to link MisakiSwift as a dynamic framework. For iOS apps (like KokoroTestApp) this works fine. For CLI tools distributed via Homebrew, it creates significant packaging challenges:
DYLD_FRAMEWORK_PATHfrom signed binaries, preventing environment-variable workaroundsThe proposed change
Remove the explicit
typedeclaration, letting SPM decide based on the downstream consumer's needs:When
typeis omitted, SPM automatically chooses static or dynamic linking based on what works best for the consuming package. Apps that need dynamic linking still get it; CLI tools that need static linking get that instead.Impact
Note on resources
MisakiSwift bundles resource files (lexicon dictionaries, BART model weights). SPM handles resource bundles correctly for both static and dynamic libraries - the
Bundle.moduleaccessor works in both cases. This is well-supported since Swift 5.3.Thank you for considering this. Happy to discuss or adjust the approach.