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:
@@ -12,9 +12,9 @@
|
||||
// `initialize` / `initialized`, `textDocument/didOpen` / `didChange`, and
|
||||
// `textDocument/completion`.
|
||||
//
|
||||
// macOS only — the whole live-compile surface shells out to the toolchain.
|
||||
// macOS/Linux only — the whole live-compile surface shells out to the toolchain.
|
||||
|
||||
#if os(macOS)
|
||||
#if os(macOS) || os(Linux)
|
||||
import Foundation
|
||||
|
||||
/// Nanoseconds in one second — for `Task.sleep`.
|
||||
@@ -80,8 +80,22 @@ public final class SourceKitLSPClient: @unchecked Sendable {
|
||||
/// Resolve `sourcekit-lsp` from the active toolchain via `xcrun`, falling
|
||||
/// back to the conventional Xcode path.
|
||||
private static func resolveExecutable() -> URL {
|
||||
// Guard the xcrun spawn: `xcrun` is macOS-only, and on Linux
|
||||
// `Process.run()` throws for a missing launch path while a following
|
||||
// `waitUntilExit()` on the never-started process BLOCKS FOREVER (a no-op
|
||||
// on macOS). Skip straight to the conventional path there, where the
|
||||
// toolchain ships `/usr/bin/sourcekit-lsp`.
|
||||
let xcrunPath: String = "/usr/bin/xcrun"
|
||||
guard FileManager.default.isExecutableFile(atPath: xcrunPath) else {
|
||||
// No xcrun (Linux): prefer a `sourcekit-lsp` on $PATH (swiftly, a
|
||||
// custom toolchain, …) over the conventional /usr/bin location.
|
||||
if let onPath: String = livecompileExecutableOnPath("sourcekit-lsp") {
|
||||
return URL(fileURLWithPath: onPath)
|
||||
}
|
||||
return URL(fileURLWithPath: "/usr/bin/sourcekit-lsp")
|
||||
}
|
||||
let xcrun: Process = Process()
|
||||
xcrun.executableURL = URL(fileURLWithPath: "/usr/bin/xcrun")
|
||||
xcrun.executableURL = URL(fileURLWithPath: xcrunPath)
|
||||
xcrun.arguments = ["--find", "sourcekit-lsp"]
|
||||
let out: Pipe = Pipe()
|
||||
xcrun.standardOutput = out
|
||||
|
||||
Reference in New Issue
Block a user