Skip to content

Fix CI: pin Linux runner to 22.04 and repair AudioUnit registration#42

Merged
johnnyclem merged 4 commits into
mainfrom
claude/fix-ci-linux-and-audiounit
Jul 1, 2026
Merged

Fix CI: pin Linux runner to 22.04 and repair AudioUnit registration#42
johnnyclem merged 4 commits into
mainfrom
claude/fix-ci-linux-and-audiounit

Conversation

@johnnyclem

Copy link
Copy Markdown
Owner

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@v1 aborts with:

Error: Version "24.04" of Ubuntu is not supported

GitHub's ubuntu-latest now resolves to Ubuntu 24.04, which that action version predates, so the job dies before building. Pinned the Linux job to ubuntu-22.04 (supported by setup-swift@v1).

2. macOS job — AudioUnit compile errors

PortaDSPNodeFactory (in the canImport(AudioToolbox) branch of PortaDSPAudioUnit.swift) called:

  • PortaDSPAudioUnit.register()
  • PortaDSPAudioUnit.componentDescription

but the real AUAudioUnit subclass never declared those statics — they existed only on the Linux stub class in the #else branch. Hence:

error: type 'PortaDSPAudioUnit' has no member 'register'
error: instance member 'componentDescription' cannot be used on type 'PortaDSPAudioUnit'
error: cannot find 'AUAudioUnitError' in scope   // cascading from the broken factory body

Added to the Apple implementation, mirroring the stub's contract:

  • static let componentDescription — an effect-type AudioComponentDescription (subtype P424, manufacturer Jhnc), reusing the existing makeFourCC helper.
  • static func register() — idempotent registration via AUAudioUnit.registerSubclass(_:as:name:version:), driven by a run-once lazy static let.

Resolving the factory body also clears the cascading AUAudioUnitError scope error at instantiateSync() (the same initializer form already compiles at line 418).

Verification

  • Linux runner change is config-only.
  • The Swift change uses standard AUAudioUnit registration API and mirrors an existing working AUAudioUnitError(...) 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

claude added 4 commits July 1, 2026 05:56
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

Copy link
Copy Markdown
Owner Author

Resolved the merge conflicts with main. main had independently picked up equivalent fixes for both issues this PR addresses (the swift:5.9 container approach for the Linux CI job, and the AUAudioUnit component registration/parameterTree fixes), so the conflicting hunks in .github/workflows/ci.yml and PortaDSPAudioUnit.swift now resolve to match main exactly.

As a result, this PR is now a clean, empty diff against main (mergeable, but there's nothing left for it to change). It's safe to merge as a no-op or close as superseded — your call.


Generated by Claude Code

@johnnyclem
johnnyclem merged commit d4509cd into main Jul 1, 2026
2 checks passed
@johnnyclem
johnnyclem deleted the claude/fix-ci-linux-and-audiounit branch July 1, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants