Skip to content

Fix Swift concurrency build error blocking v0.4.0 release + add pre-tag macOS CI - #27

Merged
terraceonhigh merged 1 commit into
masterfrom
mercer/fix-swift-concurrency-ci
Jun 21, 2026
Merged

Fix Swift concurrency build error blocking v0.4.0 release + add pre-tag macOS CI#27
terraceonhigh merged 1 commit into
masterfrom
mercer/fix-swift-concurrency-ci

Conversation

@terraceonhigh

Copy link
Copy Markdown
Owner

Why

The v0.4.0 tag's release run failed at the swiftc step on the macos-14 runner (run 27889275965):

DeviceSession.swift:219:34: error: reference to captured var 'self' in concurrently-executing code
                    Task { await self?.handleUnexpectedBridgeExit() }

The G1b self-heal closure captures a weak self (modeled as a var — ARC can zero it across a concurrency boundary) and references it inside a @Sendable Task. The runner's newer Swift toolchain rejects this as a hard error; the older local toolchain only warned, so it slipped past local builds and the tag. Nothing shipped — the build died at compile, before notarization.

Fix

  • onUnexpectedExit: guard let self else { return } before the Task, so the capture is immutable.
  • onStatusLine: re-capture self immutably in the DispatchQueue.main.async capture list (same class of issue, a warning today / Swift-6 error).

Durable fix for the root cause

release.yml is tag-triggered, and the Forgejo workflow is Linux/Go only — so there was zero pre-tag macOS build coverage. New build-check.yml: a pull_request job on macos-14 running the same make dist-swiftc the release uses (plus Go build/tests), no secrets or signing. Compile-time toolchain skew now surfaces on the PR, not on a tag.

After merge

Nothing was published, so: delete + recreate the v0.4.0 tag on the fixed commit (no -retracted, no v0.4.1).

🤖 Generated with Claude Code

… build CI

The v0.4.0 release build failed at the swiftc step on the macos-14 runner:
DeviceSession's G1b self-heal closure captured a weak `self` and referenced
it inside a @sendable Task — "reference to captured var 'self' in
concurrently-executing code." A weak capture is modeled as a var (ARC can
zero it across a concurrency boundary), so the newer runner toolchain rejects
it as a hard error; the older local toolchain only warned, so it slipped past
local builds and the tag.

Fix: bind a strong, immutable `self` (guard-let) before the Task in
onUnexpectedExit, and re-capture self immutably in onStatusLine's
DispatchQueue.main.async closure.

Root cause was zero pre-tag macOS build coverage (release.yml is tag-only,
the Forgejo workflow is Linux/Go). Add build-check.yml: a pull_request job on
macos-14 that runs the same `make dist-swiftc` release.yml runs (plus the Go
build/tests), no secrets/signing — so compile-time toolchain skew surfaces on
the PR, not on a tag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@terraceonhigh
terraceonhigh merged commit e5c2f43 into master Jun 21, 2026
1 check passed
terraceonhigh added a commit that referenced this pull request Jun 21, 2026
…ing)

Session handoff at usage limit. Records: G1–G4 passed, freshness bug fixed +
verified, the v0.4.0 tag's CI failure (Swift toolchain skew) fixed via PR #27
(merged) + new pre-tag macOS build-check workflow. Sole remaining action is
retagging v0.4.0 onto the fixed master HEAD; exact commands in the block.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant