fix(desktop): dodge the Xcode 16.4 SILGen segfault on alertPresenter (#12275) - #12279
fix(desktop): dodge the Xcode 16.4 SILGen segfault on alertPresenter (#12275)#12279kodjima33 wants to merge 3 commits into
Conversation
…12275) AppState.alertPresenter's `any DesktopAlertPresenting` default-value initializer crashes swift-frontend SILGen (signal 11) on the CI-pinned Xcode 16.4 / Swift 6.1.2 toolchain. It has been on main since d49f978 and fails the real Desktop Swift CI job on every commit that touches desktop/** -- masked on main's status badge only because the required-check gate treats a path-filtered skip as success. Move the same value to the same lifecycle point (AppState.init()) instead of the stored-property default, matching the workaround already carried on three unrelated branches per #12275. Fixing that unmasked a second, pre-existing compile error in the test target: AppState+Transcription.swift:848 referenced `alertPresenter` without explicit `self` inside an escaping closure -- always invalid under `-strict-concurrency=complete -warnings-as-errors`, but never reached by the compiler because the SILGen crash aborted first. Failure-Class: none Tested: `xcrun swift build -c debug --package-path Desktop` (full app target, exit 0) and `xcrun swift test -c debug --package-path Desktop --filter AppStateAlertPresentationTests` -- 11/11 pass, 0 failures.
|
Closing — superseded. Both fixes this PR proposed are already on
Diffing this branch against current 🤖 automated by hourly watchdog — closed as superseded, not merged (main already carries the equivalent fix) |
|
Hey @kodjima33 👋 Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request. After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:
Before your next PR, please skim:
If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing. Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out. Thank you for being part of the Omi community! |
Bug
main's Desktop Swift CI has been failing on every commit that touchesdesktop/**sinced49f978512landed.AppState.alertPresenter'sany DesktopAlertPresentingstored-property default-value initializer crashesswift-frontendSILGen (signal 11) on the CI-pinned Xcode 16.4 / Swift 6.1.2 toolchain. The crash is masked onmain's status badge only because the required-check gate treats a path-filteredskippedjob as satisfying the check — see #12275 for the full trace across fourmainpushes.Root cause
Emitting the
any DesktopAlertPresentingexistential erasure through the stored-property default-value generator crashes SILGen on this toolchain (confirmed via the CI job log linked in #12275, and reproduced locally:xcrun swift build -c debug --package-path DesktoponmainHEAD before this fix fails the same way).Fix
Move the same default value to the same lifecycle point —
AppState.init()— instead of the stored-property default. No behavior change;AppStatehas exactly one initializer, andalertPresenteris assigned before anything else runs in it. This is the same workaround #12275 says is already carried on three unrelated branches.Fixing that unmasked a second, pre-existing bug in
AppState+Transcription.swift:848:alertPresenter.pauseQueueUntilAppActive()referenced the property without explicitselfinside an escaping closure, which is invalid under this package's-strict-concurrency=complete -warnings-as-errorssettings. It was never reached by the compiler because the SILGen crash aborted first. Added the requiredself..What I tested
xcrun swift build -c debug --package-path Desktop— full app target, exit 0 (previously crashed with signal 11 onmainHEAD).xcrun swift test -c debug --package-path Desktop --filter AppStateAlertPresentationTests— 11/11 tests pass, 0 failures (previously could not even compile the test target).Running the pinned
swift-formatlint scope after both fixes above surfaced one more piece of the same masked breakage:AppState+Permissions.swift:106had formatting drift introduced by the samed49f978512commit — CI's static-lint step never ran against it because the SILGen crash on the same commit aborted the job before reaching that step. Applied the pinned formatter (mechanical output only, no behavior change) sodesktop-swift-format-lintpasses clean.Scope
Part 2 of #12275 (the CI gate that let
skippedsatisfy a required check) is out of scope here — it lives in.github/workflows/, which is out of bounds for this fix.Failure-Class: none
🤖 automated by hourly watchdog — tested and merged