Fix CI: pin Linux runner to 22.04 and repair AudioUnit registration#42
Merged
Conversation
Two pre-existing CI failures on main, unrelated to each other: - Linux job died in swift-actions/setup-swift@v1 with "Version 24.04 of Ubuntu is not supported" because `ubuntu-latest` now resolves to Ubuntu 24.04, which that action version predates. Pin the job to ubuntu-22.04. - macOS job failed to compile PortaDSPNodeFactory: it calls PortaDSPAudioUnit.register() and .componentDescription, but the real AUAudioUnit subclass never declared those statics — they existed only on the Linux stub class. Add a static componentDescription and an idempotent register() (via AUAudioUnit.registerSubclass) to the Apple implementation, which also resolves the cascading 'AUAudioUnitError' scope error in instantiateSync(). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CJTwEPDS71A9cFJFnpjB63
Deeper CI diagnosis from the PR build surfaced more than the first log showed: Linux: pinning to ubuntu-22.04 got past the "24.04 not supported" error but swift-actions/setup-swift@v1 then failed at its GPG key-import step. The action is unmaintained; switch to the official `swift:5.9` container image, which ships the toolchain and needs no download/verify step. macOS: PortaDSPAudioUnit.swift (the canImport(AudioToolbox) branch) never imported the C bridge, so every porta_create/porta_destroy/porta_update_params/ porta_process_interleaved/porta_get_meters_dbfs call was out of scope. Import PortaDSPBridge (as PortaDSPWrapper.swift does) and drop the conflicting local porta_dsp_handle typealias so the handle type comes from the C module. Also replace two throws of the non-existent `AUAudioUnitError` type with NSError(domain: NSOSStatusErrorDomain, code:) using kAudioUnitErr_FormatNotSupported and kAudioUnitErr_FailedInitialization. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CJTwEPDS71A9cFJFnpjB63
With the earlier scope errors resolved, the compiler reached an init-order error: `self.parameterTree` (an AUAudioUnit superclass property) was assigned before `super.init`. Move the assignment to after super.init. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CJTwEPDS71A9cFJFnpjB63
…-conflicts-jca0m5 # Conflicts: # .github/workflows/ci.yml # Packages/PortaDSPKit/Sources/PortaDSPKit/PortaDSPAudioUnit.swift
Owner
Author
|
Resolved the merge conflicts with As a result, this PR is now a clean, empty diff against Generated by Claude Code |
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.
Overview
Fixes the two pre-existing CI failures on
main(surfaced by the checks on #41, but unrelated to that web-only PR and unrelated to each other).1. Linux job — runner image
swift-actions/setup-swift@v1aborts with:GitHub's
ubuntu-latestnow resolves to Ubuntu 24.04, which that action version predates, so the job dies before building. Pinned the Linux job toubuntu-22.04(supported bysetup-swift@v1).2. macOS job — AudioUnit compile errors
PortaDSPNodeFactory(in thecanImport(AudioToolbox)branch ofPortaDSPAudioUnit.swift) called:PortaDSPAudioUnit.register()PortaDSPAudioUnit.componentDescriptionbut the real
AUAudioUnitsubclass never declared those statics — they existed only on the Linux stub class in the#elsebranch. Hence:Added to the Apple implementation, mirroring the stub's contract:
static let componentDescription— an effect-typeAudioComponentDescription(subtypeP424, manufacturerJhnc), reusing the existingmakeFourCChelper.static func register()— idempotent registration viaAUAudioUnit.registerSubclass(_:as:name:version:), driven by a run-once lazystatic let.Resolving the factory body also clears the cascading
AUAudioUnitErrorscope error atinstantiateSync()(the same initializer form already compiles at line 418).Verification
AUAudioUnitregistration API and mirrors an existing workingAUAudioUnitError(...)usage in the same file. Note: this environment has no macOS/Xcode toolchain, so the Apple-framework path could not be compiled locally — CI on this PR is the validating build. Both jobs should go green here.🤖 Generated with Claude Code
https://claude.ai/code/session_01CJTwEPDS71A9cFJFnpjB63
Generated by Claude Code