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:
2026-06-01 21:05:13 -07:00
parent e903196639
commit 2fa4bfd45e
7 changed files with 73 additions and 87 deletions
@@ -165,12 +165,8 @@ Writes a starter ``SynthesizerBase`` subclass into your project.
## Adding Lyrebird to your own Xcode project
If you're not using the scaffolder — adding Lyrebird as a dependency of an
existing or hand-made Xcode project — there are three settings to know. The
generated templates set these for you; a hand-made project needs them applied
manually.
### 1. Add the package and product
Adding Lyrebird as a dependency of an existing or hand-made Xcode project is a
single step — no special build settings required.
**File ▸ Add Package Dependencies…**, enter the repository URL:
@@ -179,47 +175,25 @@ https://realizedsound.mooo.com/josh/Lyrebird.git
```
Choose **Up to Next Major Version** from `1.0.0`, then add the `Lyrebird`
product (and `LyrebirdUI` if you use the SwiftUI controls) to your target.
product (and `LyrebirdUI` if you use the SwiftUI controls) to your target. In
your source write `import LyrebirdSynth` — the *product* is named `Lyrebird`,
the *module* it vends is `LyrebirdSynth`.
For an **app** target, confirm Lyrebird appears under **General ▸ Frameworks,
Libraries, and Embedded Content** with **Embed & Sign** selected — Xcode sets
this automatically for apps. A plain command-line / SwiftPM executable target
needs no embed step.
The `Lyrebird` product uses **automatic linkage**, so SwiftPM/Xcode link it
**statically** into your target. There is no dynamic framework to embed and no
ad-hoc-signed dylib to load, which means:
### 2. Hardened Runtime → disable library validation
- **No** `com.apple.security.cs.disable-library-validation` entitlement.
- **No** `SWIFT_USE_INTEGRATED_DRIVER` / `parallelizeBuildables` override.
- Works as-is under Hardened Runtime, App Sandbox, and AUv3.
`Lyrebird` is built as a **dynamic** library (`type: .dynamic` in its
`Package.swift` — a deliberate workaround for an Xcode 26 SwiftPM regression,
reverting to `.static` once fixed). The SwiftPM-built `libLyrebird.dylib` is
ad-hoc-signed, not signed by your team. Any target with **Hardened Runtime**
enabled — every signed/notarized app, and **all** AUv3 extensions — will
otherwise fail at launch with:
```
dyld: Library not loaded: @rpath/libLyrebird.dylib
```
Fix: add this key to the target's `.entitlements`, then clean build (⇧⌘K):
```xml
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
```
A plain debug app **without** Hardened Runtime doesn't need this — skip it.
### 3. Xcode 26 Swift-driver workaround
If the build fails with Swift driver errors, set in **Build Settings**:
- `SWIFT_USE_INTEGRATED_DRIVER = NO`
- `parallelizeBuildables = NO`
Both are temporary, tied to the same Xcode 26 regression as the dynamic-library
choice.
> The `lyrebird new --template macos-ui-xcode | ios-ui | auv3` scaffolds apply
> all three automatically. Reach for them if you'd rather not wire this by hand.
> The package also vends an internal `LyrebirdDynamic` (`type: .dynamic`)
> product used **only** by the bundled `LiveCompile/` live-coding sub-package
> (it needs a shared dylib so live-compiled snippets and the host resolve to one
> copy of every class). External consumers never reference `LyrebirdDynamic`.
> The demo workspace and AUv3 sample link that dynamic product, which is why
> *those* projects carry the `disable-library-validation` entitlement and the
> Xcode-26 driver settings — your own project does not.
---