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:
@@ -62,7 +62,17 @@ struct ProjectScaffolderBuildTests {
|
||||
/// Raw strings (not `ProjectTemplate` cases) are the parametrized arguments
|
||||
/// because `@Test(arguments:)` requires `Sendable` and the public
|
||||
/// `ProjectTemplate` enum does not declare the conformance.
|
||||
static let spmTemplateRawValues: [String] = ["quickstart", "basic", "demo", "nrt", "score", "ui-demo"]
|
||||
///
|
||||
/// `ui-demo` emits `import AppKit` / `NSApplication`, so it is Apple-only by
|
||||
/// construction and is dropped off Apple rather than being expected to
|
||||
/// build there.
|
||||
static let spmTemplateRawValues: [String] = {
|
||||
var templates: [String] = ["quickstart", "basic", "demo", "nrt", "score"]
|
||||
#if canImport(AppKit)
|
||||
templates.append("ui-demo")
|
||||
#endif
|
||||
return templates
|
||||
}()
|
||||
|
||||
@Test(arguments: spmTemplateRawValues)
|
||||
func templateBuildsAgainstLiveLyrebird(_ rawValue: String) throws {
|
||||
@@ -100,15 +110,54 @@ struct ProjectScaffolderBuildTests {
|
||||
`swift build` failed for template \(template.rawValue) (exit \(result.exitCode)):
|
||||
\(result.output)
|
||||
""")
|
||||
guard result.exitCode == 0 else { return }
|
||||
|
||||
// Compiling is not the same as working. The offline-render templates
|
||||
// pick an output container, and a container the platform cannot write
|
||||
// (CAF off Apple) fails only at run time — a build-only check calls
|
||||
// that healthy. So actually run them and require the file to appear.
|
||||
guard let expectedOutput: String = Self.renderedOutputFileName(for: template) else { return }
|
||||
let run: (exitCode: Int32, output: String) = try Self.runSwiftRun(in: projectRoot)
|
||||
#expect(run.exitCode == 0,
|
||||
"""
|
||||
`swift run` failed for template \(template.rawValue) (exit \(run.exitCode)):
|
||||
\(run.output)
|
||||
""")
|
||||
let renderedPath: String = (projectRoot as NSString).appendingPathComponent(expectedOutput)
|
||||
#expect(fm.fileExists(atPath: renderedPath),
|
||||
"template \(template.rawValue) ran but wrote no \(expectedOutput)")
|
||||
}
|
||||
|
||||
/// The file a template is expected to render, or `nil` for templates that
|
||||
/// open an audio device or a window instead of writing one.
|
||||
private static func renderedOutputFileName(for template: ProjectTemplate) -> String? {
|
||||
switch template.rawValue {
|
||||
case "nrt": return "output.wav"
|
||||
case "score": return "score.wav"
|
||||
default: return nil
|
||||
}
|
||||
}
|
||||
|
||||
/// Run `swift run` in `directory`, capturing merged stdout+stderr.
|
||||
private static func runSwiftRun(in directory: String) throws -> (exitCode: Int32, output: String) {
|
||||
try runProcess(["swift", "run"], in: directory)
|
||||
}
|
||||
|
||||
// MARK: - swift build runner
|
||||
|
||||
/// Run `swift build` in `directory`, capturing merged stdout+stderr.
|
||||
private static func runSwiftBuild(in directory: String) throws -> (exitCode: Int32, output: String) {
|
||||
try runProcess(["swift", "build"], in: directory)
|
||||
}
|
||||
|
||||
/// Run a command in `directory`, capturing merged stdout+stderr.
|
||||
private static func runProcess(
|
||||
_ arguments: [String],
|
||||
in directory: String
|
||||
) throws -> (exitCode: Int32, output: String) {
|
||||
let process: Process = Process()
|
||||
process.executableURL = URL(fileURLWithPath: "/usr/bin/env")
|
||||
process.arguments = ["swift", "build"]
|
||||
process.arguments = arguments
|
||||
process.currentDirectoryURL = URL(fileURLWithPath: directory)
|
||||
|
||||
let pipe: Pipe = Pipe()
|
||||
|
||||
Reference in New Issue
Block a user