Lyrebird 2.0.0 — Linux support

Consolidated release: the cross-platform Linux port (engine, generators, CLI,
REPL, NRT, portable DSP), live ALSA audio + ALSA MIDI + POSIX OSC + portable
WAV codec, the GTK4 GUI (LyrebirdUI on the SwiftOpenUI backend), and the Linux
live-coding scratchpad (LiveCompile). Apple platforms unchanged; all additive.
See RELEASES.md and LINUX_README.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-09-10 21:09:11 -07:00
parent 77580ee98e
commit b6fdee8bfc
293 changed files with 16800 additions and 775 deletions
+162
View File
@@ -0,0 +1,162 @@
#!/usr/bin/env bash
# scripts/ci-local.sh
# Local Docker mirror of bitbucket-pipelines.yml — run the Linux CI steps on
# your own machine before pushing, so most breaks are caught without spending
# BitBucket build minutes. This is the fast half of the hybrid CI: local Docker
# for every push, BitBucket only at real gates (merge to develop/main, releases)
# for the authoritative x86_64 run + status check.
#
# Usage:
# scripts/ci-local.sh # native (host arch, e.g. arm64) — fast
# scripts/ci-local.sh --amd64 # emulate x86_64 (qemu) to match BitBucket
# scripts/ci-local.sh --livecompile # also build the LiveCompile sub-package
# scripts/ci-local.sh --clean # discard the cached build tree first
# scripts/ci-local.sh --amd64 --livecompile --clean # flags combine
#
# Why --amd64: your dev machine is arm64; BitBucket's runners are x86_64. arm64
# Docker misses x86-only breaks (flush-to-zero, alignment, codegen). The native
# run catches ~all logic breaks in a fraction of the time; do one --amd64 pass
# before a release/merge to catch the arch-specific ones without hosted minutes.
#
# --livecompile builds the LiveCompile sub-package + the Linux scratch demo
# against the local SwiftOpenUI fork (LYREBIRD_SWIFTOPENUI_LOCAL). This is NOT
# part of the hosted pipeline (the pipeline builds the main package only), so it
# is opt-in here — and it lets the whole run resolve against the fork checkout
# even before a fork release tag is pushed.
#
# Build cache: the Linux build tree lives in a per-arch NAMED DOCKER VOLUME
# (lyrebird-ci-build-<arch>, plus lyrebird-ci-live-<arch> for --livecompile),
# NOT in the repo's ./.build. That keeps Linux artifacts off your host (no macOS
# ./.build pollution, no "module cache compiled with path X" breakage from a
# changing mount point) while still persisting the cache between runs. --clean
# just deletes those volumes.
#
# Env overrides:
# LYREBIRD_CI_IMAGE Docker image (default lyrebird-linux-full:local)
# LYREBIRD_SWIFTOPENUI_LOCAL_HOST fork path for --livecompile
# (default ~/Documents/src/SwiftOpenUI)
#
# Network: a cold run clones the package dependencies (swift-docc-plugin, Nimble,
# …) from GitHub, exactly as the hosted pipeline does — so the first run needs
# internet. The per-arch build volume then caches them, so later runs (and
# --amd64 after its first) are offline-capable until you --clean.
#
# Requires: Docker, and the lyrebird-linux-full:local image. The image does not
# ship libgtksourceview-5-dev, so the run apt-installs the GTK dev packages
# (idempotent) exactly as the hosted pipeline does — bake them into a dedicated
# image later if the per-run apt cost becomes annoying.
set -euo pipefail
IMAGE="${LYREBIRD_CI_IMAGE:-lyrebird-linux-full:local}"
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
FORK_HOST="${LYREBIRD_SWIFTOPENUI_LOCAL_HOST:-$HOME/Documents/src/SwiftOpenUI}"
# The repo is always mounted at the SAME container path (/work) so SwiftPM's
# precompiled module cache — which bakes in the absolute path — stays valid.
MOUNT_PATH="/work"
PLATFORM_ARGS=()
ARCH_TAG="$(uname -m)" # arm64 / x86_64 for native
ARCH_LABEL="native ($ARCH_TAG)"
RUN_LIVECOMPILE=0
RUN_CLEAN=0
for arg in "$@"; do
case "$arg" in
--amd64) PLATFORM_ARGS=(--platform linux/amd64); ARCH_TAG="amd64"; ARCH_LABEL="emulated linux/amd64" ;;
--livecompile) RUN_LIVECOMPILE=1 ;;
--clean) RUN_CLEAN=1 ;;
-h|--help) sed -n '2,45p' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
*) echo "unknown arg: $arg (try --help)" >&2; exit 2 ;;
esac
done
BUILD_VOL="lyrebird-ci-build-${ARCH_TAG}"
LIVE_VOL="lyrebird-ci-live-${ARCH_TAG}"
echo "== Lyrebird local CI =="
echo "image: $IMAGE"
echo "arch: $ARCH_LABEL"
echo "repo mount: $REPO_ROOT -> $MOUNT_PATH (source only; build tree in volume $BUILD_VOL)"
echo "livecompile: $RUN_LIVECOMPILE clean: $RUN_CLEAN"
echo
if [[ "$RUN_CLEAN" == 1 ]]; then
echo "== clean: removing build-cache volumes =="
docker volume rm -f "$BUILD_VOL" "$LIVE_VOL" >/dev/null 2>&1 || true
fi
# The main-package steps, verbatim from bitbucket-pipelines.yml (only the
# no-ALSA scratch path is redirected under the build volume so it doesn't land
# in the source tree).
read -r -d '' PIPELINE <<'EOF' || true
set -euo pipefail
mkdir -p "$HOME/.cache"
swift --version
apt-get update && apt-get install -y --no-install-recommends libgtk-4-dev libgtksourceview-5-dev libfontconfig-dev libasound2-dev pkg-config
echo "== core build gate =="
swift build --target LyrebirdSynth --target LyrebirdGraphDSL --target LyrebirdCLI
echo "== UI build gate (LyrebirdUILinuxDemo) =="
swift build --product LyrebirdUILinuxDemo
echo "== swift test =="
swift test
echo "== swift test (LYREBIRD_DISABLE_ALSA) =="
LYREBIRD_DISABLE_ALSA=1 swift test --scratch-path /work/.build/noalsa
EOF
if [[ "$RUN_LIVECOMPILE" == 1 ]]; then
PIPELINE="$PIPELINE"'
echo "== LiveCompile sub-package (against local fork /fork) =="
cd /work/LiveCompile
swift build
swift build --product LyrebirdScratchLinuxDemo
echo "== LiveCompile tests =="
# --no-parallel + a hard timeout: a snippet-compiling test that fails to build
# can otherwise hang forever awaiting a callback (see the LiveCompile notes).
timeout --signal=KILL 1200 swift test --no-parallel'
fi
# The repo is mounted writable because SwiftPM writes Package.resolved at the
# package root during resolution. The build trees live in the named volumes, so
# the only thing a run can touch in the working copy is Package.resolved — which
# a plain (non-livecompile) run's Linux resolve rewrites to add the by-URL
# SwiftOpenUI pin. Restore it after the run (below) so the working copy stays
# clean. (A --livecompile run resolves the fork as a path dependency, which
# doesn't appear in Package.resolved, so there is nothing to restore there.)
# HOME points at a fresh dir inside the build volume so SwiftPM's global package
# cache (~/.cache/org.swift.swiftpm) is clean and writable — the base image
# ships an inconsistent one that makes a cold `swift build` fail resolving
# swift-docc-plugin ("cannot change to .../repositories/...: No such file").
# Living in the volume, it also persists warm between runs.
DOCKER_ARGS=(--rm)
[[ ${#PLATFORM_ARGS[@]} -gt 0 ]] && DOCKER_ARGS+=("${PLATFORM_ARGS[@]}")
DOCKER_ARGS+=(
-v "$REPO_ROOT:$MOUNT_PATH"
-v "$BUILD_VOL:$MOUNT_PATH/.build"
-e "HOME=$MOUNT_PATH/.build/home"
)
if [[ "$RUN_LIVECOMPILE" == 1 ]]; then
if [[ ! -d "$FORK_HOST" ]]; then
echo "livecompile: fork not found at $FORK_HOST" >&2
echo " set LYREBIRD_SWIFTOPENUI_LOCAL_HOST to the SwiftOpenUI fork path." >&2
exit 3
fi
DOCKER_ARGS+=(
-v "$FORK_HOST:/fork:ro"
-v "$LIVE_VOL:$MOUNT_PATH/LiveCompile/.build"
-e LYREBIRD_SWIFTOPENUI_LOCAL=/fork
)
fi
# Keep the working copy clean regardless of how the run exits: a plain run's
# Linux resolve rewrites Package.resolved (adds the by-URL SwiftOpenUI pin).
restore_resolved() {
git -C "$REPO_ROOT" checkout -- Package.resolved 2>/dev/null || true
}
trap restore_resolved EXIT
docker run "${DOCKER_ARGS[@]}" -w "$MOUNT_PATH" "$IMAGE" bash -lc "$PIPELINE"
echo
echo "== local CI PASSED ($ARCH_LABEL) =="
+5 -2
View File
@@ -2,12 +2,14 @@ CLAUDE.md 0 32f17b53fdca9658 none
CLAUDE.md 4 484fda136104c034 none
INSTALLATION_AND_USAGE.md 6 6ee5041ca9018275 none
INSTALLATION_AND_USAGE.md 7 8a7f2353f90dea3e none
LYREBIRD_START_HERE.md 0 a2547833f11acd72 none
LYREBIRD_START_HERE.md 3 c0653ad6f9dc0f5b none
LYREBIRD_START_HERE.md 4 3d0d1e2673fda229 none
README.md 0 1d7c7c19c5a6d112 none
README.md 1 3190dd60b6a8f7f8 none
README.md 3 4bd7e864af2f05fd none
Sources/Lyrebird/AudioDrivers/CoreAudioDriver.swift 0 2b7f04ec486a9a5d none
Sources/Lyrebird/AudioDrivers/DefaultAudioDriver.swift 0 5b79c5afb54ed465 none
Sources/Lyrebird/Buffers/WavetableSet.swift 0 d2f7469591d6a837 none
Sources/Lyrebird/Capture/ScopeCapture.swift 0 08174c110eb5680b engine
Sources/Lyrebird/Diagnostics/LyrebirdMessageCenter.swift 0 42a857719bcee2d7 none
@@ -361,7 +363,7 @@ Sources/Lyrebird/Math/LyrebirdMusicMath.swift 4 0ed12cba2d54fb0c none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 5 c93b09a35c5656b6 none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 6 1e2f63b9517d115d none
Sources/Lyrebird/Math/LyrebirdMusicMath.swift 7 63878da5cac0b38e none
Sources/Lyrebird/OSC/OSCClient.swift 0 fd200fc7a209f81d none
Sources/Lyrebird/OSC/OSCClient.swift 0 8d156b807b49c1a5 none
Sources/Lyrebird/Scheduling/LyrebirdTask.swift 1 ca99def354fe2f0a engine
Sources/Lyrebird/Score/Glissando.swift 0 673ddef8256aa6b3 none
Sources/Lyrebird/Score/NoteDisplay.swift 0 f706dacb94d58307 none
@@ -399,6 +401,7 @@ docs/diagnostics-guide.md 3 4f36c6bd97e3df32 none
docs/diagnostics-guide.md 4 f1c7f9029c6f48ea none
docs/diagnostics-guide.md 8 8efe9dc71d2dd8dd engine
docs/diagnostics-guide.md 9 a0ccfaf1137b9c84 engine
docs/engine/alsa-audio-driver.md 0 d255cf28c7eff929 none
docs/engine/bus-system.md 0 7aa0d214382e2c02 none
docs/engine/bus-system.md 4 1420e89a6b21dffd member
docs/engine/bus-system.md 5 5882de3452d3fb30 member
@@ -564,5 +567,5 @@ docs/tooling/routine-task.md 11 b95b191b847d061e engine
docs/tooling/routine-task.md 9 be652d2b3b6f274f none
docs/tooling/targets.md 0 81b40cbafc6f2d80 none
docs/tooling/targets.md 1 611af51e70b6320e none
docs/ui/gui-system.md 0 4b0e892ca2593cf1 none
docs/ui/gui-system.md 0 84caaf99ee346e95 none
docs/ui/gui-system.md 1 35476e25ce32f68f none