Static consumer product + internal dynamic for LiveCompile
The Lyrebird product was forced type: .dynamic, forcing an SPM dynamic framework on consumers and hitting the Xcode 26 regression (PackageFrameworks/Lyrebird.framework binary missing). Split into two products vending the same LyrebirdSynth target: • Lyrebird (automatic → static): consumer-facing, no framework, no workarounds. • LyrebirdDynamic (.dynamic): internal-only, consumed by LiveCompile. LiveCompile repointed to LyrebirdDynamic with linker refs updated (libLyrebirdDynamic.dylib). README + GettingStarted updated: consumers link static and need no disable-library-validation entitlement or driver override. Verified: core + LiveCompile (34/34) build/test clean; external consumer links the static product with no dynamic dylib. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -141,18 +141,9 @@ Add the package:
|
||||
https://realizedsound.mooo.com/josh/Lyrebird.git
|
||||
```
|
||||
|
||||
**File ▸ Add Package Dependencies…** → that URL → **Up to Next Major** from `1.0.0` → add the `Lyrebird` product (and `LyrebirdUI` for the SwiftUI controls).
|
||||
**File ▸ Add Package Dependencies…** → that URL → **Up to Next Major** from `1.0.0` → add the `Lyrebird` product (and `LyrebirdUI` for the SwiftUI controls). Write `import LyrebirdSynth` in your code (the product is `Lyrebird`; the module it vends is `LyrebirdSynth`).
|
||||
|
||||
Then three settings a hand-made project needs (the `lyrebird new` scaffolds set all three for you):
|
||||
|
||||
1. **Embed the framework.** App targets: confirm Lyrebird shows under *General ▸ Frameworks, Libraries, and Embedded Content* as **Embed & Sign** (Xcode sets this automatically). CLI/SwiftPM executables need no embed.
|
||||
2. **Disable library validation** — required for any target with **Hardened Runtime** (signed apps + all AUv3). `Lyrebird` ships as a `.dynamic` library; its SPM-built `libLyrebird.dylib` is ad-hoc-signed, so dyld otherwise fails with `dyld: Library not loaded`. Add to the target's `.entitlements`, then clean build (⇧⌘K):
|
||||
```xml
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
```
|
||||
Plain debug apps without Hardened Runtime can skip this.
|
||||
3. **Xcode 26 Swift-driver workaround** (only if the build throws Swift driver errors): set `SWIFT_USE_INTEGRATED_DRIVER = NO` and `parallelizeBuildables = NO` in Build Settings.
|
||||
That's it — the `Lyrebird` product links **statically**, so there's no dynamic framework, no embed step, and **no special build settings**: you do *not* need a `disable-library-validation` entitlement or a `SWIFT_USE_INTEGRATED_DRIVER` override. It just links, even under Hardened Runtime / sandbox / AUv3.
|
||||
|
||||
Full walk-through (SPM manifest form, local-path dev dependency, per-template details): [`INSTALLATION_AND_USAGE.md`](INSTALLATION_AND_USAGE.md). DocC version: **Getting Started ▸ Adding Lyrebird to your own Xcode project**.
|
||||
|
||||
@@ -193,8 +184,8 @@ Use `Lyrebird-Package` for day-to-day development of the engine and tests.
|
||||
| `Synchronization.Atomic` not indexed | Requires Xcode 16+ — false errors in older versions, still builds |
|
||||
| LineNoise concurrency warnings | Expected — `LyrebirdCLI` uses `.swiftLanguageMode(.v5)` intentionally |
|
||||
| Nimble in Package dependencies | Cosmetic — LineNoise transitive dep, never built in Lyrebird targets |
|
||||
| Build fails with Swift driver errors | Xcode 26 bug — workspace already sets `SWIFT_USE_INTEGRATED_DRIVER = NO`, `parallelizeBuildables = NO`, `type: .dynamic`. In your own project see [Adding Lyrebird to your own project](#adding-lyrebird-to-your-own-project) |
|
||||
| `dyld: Library not loaded` | Hardened Runtime rejects the ad-hoc-signed SPM framework — add `com.apple.security.cs.disable-library-validation = true` to entitlements, then clean build (⇧⌘K). Full steps: [Adding Lyrebird to your own project](#adding-lyrebird-to-your-own-project) |
|
||||
| Build fails with Swift driver errors | Xcode 26 bug affecting the **demo workspace** (which dynamic-links for live-coding) — it already sets `SWIFT_USE_INTEGRATED_DRIVER = NO` + `parallelizeBuildables = NO`. Your own project links Lyrebird statically and is unaffected. |
|
||||
| `dyld: Library not loaded` | Only the bundled demos/AUv3 use the dynamic `LyrebirdDynamic` product; their entitlements already set `disable-library-validation`. External consumers link the static `Lyrebird` product and never hit this. |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user