From 1fde1126cc185958a0425c4a92fd3cc8c0a211c3 Mon Sep 17 00:00:00 2001 From: Eric Dahl Date: Thu, 3 Dec 2026 01:30:08 -0500 Subject: [PATCH] Destinations builds on Linux: the bookmark store is Apple-only; CI builds the Linux modules (#13) Security-scoped bookmarks exist only in Apple's Foundation, so `DriveFolderStore` and its tests are compiled only where Darwin is. Nothing changes on Apple platforms. A new Linux CI job builds the modules and test targets that use no Apple framework. Co-Authored-By: Claude Fable 5.2 --- .github/workflows/ci.yml | 21 +++++++++++++++++++ Sources/Destinations/Destinations.swift | 3 +++ .../DriveFolderStoreTests.swift | 3 +++ 3 files changed, 27 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd599a2..4b40d43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,3 +60,24 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.lcov fail_ci_if_error: false + + linux: + name: Linux build + # The modules that use no Apple framework must build on Linux, where SoundcheckPlayer tests its pure targets (#13). + # Not the whole package: CoreAudioIO, MixerLink, Appearance and Meters need AudioToolbox, Network and SwiftUI, and + # BroadcastWaveTests needs AVFoundation. `swift test` builds every test target, so the tests run on macOS only. + runs-on: ubuntu-latest + container: swift:6.2 + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + + - name: Show toolchain + run: swift --version + + - name: Build the modules and test targets that use no Apple framework + run: | + for target in AudioIO BroadcastWave OSC AutoGain Telemetry Destinations TakeFile Shows \ + AudioIOTests OSCTests AutoGainTests TelemetryTests DestinationsTests ShowsTests; do + swift build --target "$target" + done diff --git a/Sources/Destinations/Destinations.swift b/Sources/Destinations/Destinations.swift index 1e3405a..9ba87b0 100644 --- a/Sources/Destinations/Destinations.swift +++ b/Sources/Destinations/Destinations.swift @@ -110,6 +110,8 @@ public enum DriveStatus: Equatable, Sendable { case unavailable(DriveProblem) } +// Security-scoped bookmarks exist only in Apple's Foundation, so the store is left out elsewhere (Linux, #13). +#if canImport(Darwin) /// The operator's Drive folder: chosen once, remembered with a security-scoped bookmark. public struct DriveFolderStore: Sendable { private let storage: any BookmarkStorage @@ -267,6 +269,7 @@ public struct DriveFolderStore: Sendable { return availableBytes(at: url) } } +#endif /// The Drive folder opened for one Take, held until the Take is finalized and Repaired. `end()` lets it go /// (for a bookmarked folder, its security scope). diff --git a/Tests/DestinationsTests/DriveFolderStoreTests.swift b/Tests/DestinationsTests/DriveFolderStoreTests.swift index ff163b9..c5f0017 100644 --- a/Tests/DestinationsTests/DriveFolderStoreTests.swift +++ b/Tests/DestinationsTests/DriveFolderStoreTests.swift @@ -2,6 +2,8 @@ import Destinations import Foundation import Testing +// `DriveFolderStore` is Apple-only (#13). +#if canImport(Darwin) @Suite("Drive folder") struct DriveFolderStoreTests { let folder: URL @@ -212,3 +214,4 @@ final class ThreadNotingStorage: BookmarkStorage, @unchecked Sendable { } func save(_ folder: StoredDriveFolder?) {} } +#endif