Skip to content

sentry: gate MXMetricPayload override behind Swift 6.2 (unblocks CI) - #114

Merged
BenevolentFutures merged 1 commit into
mainfrom
sentry-metricpayload-sdk-gate
May 4, 2026
Merged

BenevolentFutures merged 1 commit into
mainfrom
sentry-metricpayload-sdk-gate

Conversation

@BenevolentFutures

Copy link
Copy Markdown
Contributor

Summary

Unblocks build (ci.yml) and mailbox-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-xlarge and 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

  • Local: Xcode 26.3 toolchain (Swift 6.2.3), `xcodebuild -scheme c11-unit` green — gate evaluates true, override stays in.
  • CI: this PR's `build` and `mailbox-unit` jobs should go green for the first time since 02d9e4d — gate evaluates false, override compiles out.

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

  • Local Xcode 26 build green
  • CI `build` job green
  • CI `mailbox-unit` job green

🤖 Generated with Claude Code

`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>
@BenevolentFutures
BenevolentFutures merged commit 69b01e1 into main May 4, 2026
5 of 6 checks passed
@BenevolentFutures
BenevolentFutures deleted the sentry-metricpayload-sdk-gate branch May 4, 2026 17:32
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>
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