Repository navigation
The whole package builds and tests on Linux: files that need an Apple framework are guarded - #20
Merged
Merged
Conversation
… framework are guarded (#16) Each file that needs AudioToolbox, AVFoundation, Network or SwiftUI, or a type from such a file, is inside `#if canImport(<framework>)`. Every guard is true wherever the file compiles today, so Apple builds compile the same sources. Package.swift is unchanged. The Linux CI job now runs whole-package `swift build` and `swift test`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCgWWseQZtUzcSRzjqqQJQ
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VCgWWseQZtUzcSRzjqqQJQ
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #16
Auto-merge is off on purpose: the design in #16 (option A, guards in the sources) gets a look first.
What changed
#if canImport(<framework>)on the first line and#endifon the last. Nothing else in them changes.canImport(Network): 19 ofMixerLink's 23 files and 35 ofMixerLinkTests' 41. Only 2 files import Network; the rest need a type declared in a guarded file.canImport(SwiftUI):AppearanceStyle.swift,MeterGrid.swift,MeterGridTests.swift.canImport(AudioToolbox):CoreAudioIO/InputSession.swift(the module's other files were already inside#if os(...)).canImport(AVFoundation): 6BroadcastWaveTestsfiles. 3 import it;StemFileTests,StemReadTestsandStemRepairTestsonly borrowinfoandsamplesfromCrashSafeStemTests..github/workflows/ci.yml: the Linux job runs whole-packageswift buildandswift test(it was a list of targets), and is renamedLinux build and tests.Package.swiftis unchanged: same products and targets on every platform.Each guard is true wherever its file compiles today, so Apple builds compile the same sources. That is checked here only by the two macOS jobs.
Linux output (Swift 6.4.3, x86_64, Arch)
Before, on
main, whole-packageswift buildandswift test:After,
swift build:After,
swift test(exit 0; 136 tests in 10 test targets, one run per target):In that order: Telemetry 15, Shows 12, OSC 5, MixerLink 12 (the routing and preamp map tests), Meters 24, Destinations 0, BroadcastWave 11, AutoGain 37, AudioIO 14, Appearance 6.
SoundcheckKit
swift teston Linux with ShowKit pointed at this branch by local path: exit 0, test runs of 49, 0, 34, 70 and 5 tests passed, the same as against #15.What Linux still doesn't run
Destinations: no test runs; every test usesDriveFolderStore, which is Apple-only (Destinations doesn't compile on Linux in 0.2.0 (BookmarkCreationOptions) #13).BroadcastWave: the Stem file, read and repair tests need no Apple framework but are guarded because they share two helpers with a file that uses AVFoundation. Moving the helpers would let them run; not done here.MixerLink: the gain, session and controller logic is pure but reaches the mixer throughOSCUDPClient, which is Network. Running it on Linux needs a seam there, not a guard.Cost to keep in mind
A new file in these modules that needs an Apple framework (or a guarded type) must carry the guard, or the Linux job fails. That job is not a required check today.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VCgWWseQZtUzcSRzjqqQJQ