Repository navigation
sentry: gate MXMetricPayload override behind Swift 6.2 (unblocks CI) - #114
Merged
Merged
Conversation
`MXMetricPayload` is marked unavailable on macOS in the macOS 15.5 SDK that Xcode 16.4 ships with — and that's what `macos-15-xlarge` GitHub runners pick by default for `ci.yml` (`build` job) and `mailbox-parity.yml` (`mailbox-unit` job). The metric-payload `didReceive` override added in 02d9e4d fails to compile on those runners with: error: 'MXMetricPayload' is unavailable in macOS error: cannot override 'didReceive' which has been marked unavailable Apple made `MXMetricPayload` macOS-available in the macOS 26 SDK shipped with Xcode 26.x. The `compat-tests` workflow already uses Xcode 26.3 and compiles fine; the other two CI workflows are stuck on the 16.4 default. Gate the override on `compiler(>=6.2)`: Swift 6.2 ships with Xcode 26 alongside the new SDK; Xcode 16.4 stays on 6.1. When CI's other workflows catch up to Xcode 26 the gate becomes a no-op and the override re-engages automatically — no further code change needed. Local build (Xcode 26.3 toolchain, Swift 6.2.3) green: gate evaluates true, override is included. CI builds on Xcode 16.4 (Swift 6.1) will skip the override and compile cleanly. Diagnostic-payload handler is unchanged — `MXDiagnosticPayload` is available on both SDKs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced May 4, 2026
Merged
BenevolentFutures
added a commit
that referenced
this pull request
May 4, 2026
…tanceTests (#115) `ExternalTab.id` is a stringified UUID (bonsplit's external view), but `Workspace.panelIdFromSurfaceId(_:)` and `surfaceIdFromPanelId(_:)` are typed on the opaque `TabID` wrapper. The `comparePane` helper passes `tab.id` (String) where TabID is expected and compares `livePane.selectedTabId` (String?) against `expectedTabId` (TabID), which fails to compile on Xcode 16.4 / Swift 6.1 in CI: c11Tests/WorkspaceLayoutExecutorAcceptanceTests.swift:480:68: error: cannot convert value of type 'String' to expected argument type 'TabID' c11Tests/WorkspaceLayoutExecutorAcceptanceTests.swift:500:13: error: conflicting arguments to generic parameter 'T' ('String?' vs. 'TabID') The error has been there since the TabID wrapper was introduced; it was masked by the SentryHelper.swift compile error fixed in #114, which short-circuited the test build before this batch ran. Once #114 cleared that, this surfaces. Apply the same conversion `WorkspacePlanCapture.panelID(forTabIDString:)` uses at the v2 socket boundary: parse the UUID string and wrap with `TabID(uuid:)`. For the equality assertion, project the TabID wrapper to its canonical UUID-string form so both sides of `XCTAssertEqual` are in the same value space. Local Xcode 26 / Swift 6.2 happens to accept the old code through some inference path; CI does not. The fix compiles cleanly on both. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Unblocks
build(ci.yml) andmailbox-unit(mailbox-parity.yml) on every PR/push to main. CI has been red on these jobs since 02d9e4d (Apr 29) — last 5 main commits all hit the same compile error.What's broken
Both jobs run on
macos-15-xlargeand pick up the default Xcode 16.4 / macOS 15.5 SDK. In that SDK Apple marks `MXMetricPayload` unavailable on macOS:```
Sources/SentryHelper.swift:32:46: error: 'MXMetricPayload' is unavailable in macOS
nonisolated func didReceive(_ payloads: [MXMetricPayload]) {
^~~~~~~~~~~~~~~
Sources/SentryHelper.swift:32:22: error: cannot override 'didReceive' which has been marked unavailable
```
Apple made `MXMetricPayload` macOS-available in the macOS 26 SDK that ships with Xcode 26.x. The `compat-tests` workflow pins Xcode 26.3 and compiles fine; the other two workflows are stuck on the 16.4 default and break.
Fix
Gate the metric-payload `didReceive` override on `compiler(>=6.2)`. Swift 6.2 ships with Xcode 26 alongside the new SDK; Xcode 16.4 stays on Swift 6.1. The override stays in on Xcode 26+ (where the SDK supports it) and compiles out on Xcode 16.4 (where it doesn't). When CI's stuck workflows catch up to Xcode 26 the gate becomes a no-op automatically — no further code change.
The diagnostic-payload handler (`MXDiagnosticPayload`) is unchanged — that type is available on both SDKs.
Validation
Why this isn't deferred to a workflow change
Pinning newer Xcode in `ci.yml` / `mailbox-parity.yml` (matching what `compat-tests` does) would also work but is bigger blast radius — affects every workflow, depends on `macos-26` runner image availability, may invalidate caches. The 9-line source gate is local, reversible, and self-resolving when the runner default catches up.
Related
PR #113 (restart-registry: capture session project_dir) is also red on these same jobs for the same reason. Once this lands, that PR rebases onto main and CI goes green for it too.
Test plan
🤖 Generated with Claude Code