fix(cmux-next): Release compile crash on main-actor generic class deinits (macOS 14 target)

Merged
TE
23d ago
+25-14

The fleet Release compile of feat-cmux-next is red. swift-frontend (Xcode 26.6) crashes in EarlyPerfInliner (isCallerAndCalleeLayoutConstraintsCompatible) on the deinit of ThemedPicker.Coordinator, a MainActor class nested in the generic ThemedPicker<ID>. The crash started after the package moved to a macOS 14 deployment target (ae366487).

The cause is one class of bug. In the UI targets (defaultIsolation(MainActor)) a class's deinit is isolated, and below macOS 15 that runs through the back-deploy path. The Release inliner crashes on it for a generic class. TaskLocal+InTask's ImmediateRun already opts out with nonisolated deinit {}.

  • ThemedPicker: the pop-up's target is now one non-generic class, ThemedPickerTarget. On each update the picker sets the closure it calls. Behavior is unchanged: a choice still writes the binding, and an out-of-range index is still ignored.
  • CEFReplyWaiters and BrowserHistoryWriter.Once, the remaining main-actor generic classes, get a nonisolated deinit {}. The first fix's compile crashed next on CEFReplyWaiters. Neither class had a deinit body.

A scan of the package's Sources (generic classes, and classes nested in generic types) finds no other main-actor generic class without a nonisolated deinit.

Verification

  • Red: fleet Release compile of base afbe6faf1ec8 crashes on ThemedPicker.Coordinator's deinit.
  • Green: fleet Release compile of this head (receipt in a comment below).
  • check-concurrency.sh and crash_ratchet.py pass.

Changelog

none

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the fleet Release compile crash of feat-cmux-next: swift-frontend (Xcode 26.6) crashed in EarlyPerfInliner on the deinit of ThemedPicker.Coordinator, a MainActor class nested in the generic ThemedPicker<ID>, after the package moved to a macOS 14 deployment target.

The cause is one class of bug. In the UI targets (defaultIsolation(MainActor)) a class's deinit is isolated, and below macOS 15 that runs through the back-deploy path. The Release inliner crashes on it for a generic class; TaskLocal+InTask's ImmediateRun already opts out with nonisolated deinit {}.

  • ThemedPicker: the pop-up's target is now one non-generic class, ThemedPickerTarget. On each update the picker sets the closure it calls. Behavior is unchanged: a choice still writes the binding, and an out-of-range index is still ignored.
  • CEFReplyWaiters and BrowserHistoryWriter.Once, the remaining main-actor generic classes, get a nonisolated deinit {}. Neither had a deinit body.
  • A scan of the package's Sources finds no other main-actor generic class without a nonisolated deinit.

Verification

  • Fleet Release compile of the old base crashes on ThemedPicker.Coordinator's deinit; this head compiles green.
  • check-concurrency.sh and crash_ratchet.py pass.