Fix launch compatibility on macOS 14 and 15#785
Merged
Conversation
Comment on lines
+104
to
+109
| main_architectures = architectures(main_binary) | ||
| if require_universal and not {"arm64", "x86_64"}.issubset(main_architectures): | ||
| raise RuntimeError( | ||
| "Release executable must contain arm64 and x86_64; found " | ||
| + ", ".join(main_architectures) | ||
| ) |
Contributor
There was a problem hiding this comment.
When the main Cotabby executable is universal but an embedded framework or helper is arm64-only, this verifier still passes because --require-universal is only applied to main_binary. The x86_64 app slice can then fail at launch when dyld loads the missing dependency on an Intel or Rosetta path.
Comment on lines
+124
to
+130
| for architecture in main_architectures: | ||
| for command in foundation_models_load_commands(main_binary, architecture): | ||
| if command != "LC_LOAD_WEAK_DYLIB": | ||
| raise RuntimeError( | ||
| "FoundationModels must be weak-linked for macOS 14: " | ||
| f"{architecture} uses {command}" | ||
| ) |
Contributor
There was a problem hiding this comment.
Strong Links Hide In Frameworks
The FoundationModels weak-link check only inspects the main executable. If any bundled Mach-O under Contents/Frameworks strong-links FoundationModels.framework, the release gate passes, but macOS 14 can still abort while loading that embedded binary before the runtime availability fallback runs.
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
Fixes the pre-UI launch abort reported on older supported macOS releases by moving app and menu-bar lifecycle ownership from SwiftUI
App/MenuBarExtrascenes to stable AppKitNSApplication,NSStatusItem, andNSPopoverAPIs. Adds a release-bundle verifier and CI that launches the same universal shipping-style artifact on macOS 14 and 15, while also correcting the release archive command so it performs exactly one archive action.Validation
xcodebuild test -project Cotabby.xcodeproj -scheme Cotabby -destination platform=macOS -derivedDataPath build/DerivedData CODE_SIGNING_ALLOWED=NO— TEST SUCCEEDED, 1,691 tests, 7 skipped, 0 failuresxcodebuild ... build-for-testing— TEST BUILD SUCCEEDEDscripts/verify_macos_compatibility.py ... --require-universal— macOS 14.0 minimum verified for arm64/x86_64 across 14 Mach-O slices; FoundationModels weak linking verified-cotabby-compatibility-smoke-testlaunches — exit 0swiftlint --strict --quiet— exit 0xcodegen generateandgit diff --check— cleanLinked issues
Fixes #767
Risk / rollout notes
This replaces only the menu-bar shell and application entry point; the existing SwiftUI menu content and long-lived dependency graph remain unchanged. Status-item visibility, pause state, accepted-word count, Settings dismissal, and macOS 26 window styling are explicitly preserved. The new required compatibility workflow guards future releases against deployment-target drift, strong-linking newer frameworks, missing Intel slices, and launch-time runtime regressions on macOS 14/15.
Greptile Summary
This PR moves the macOS menu-bar shell from SwiftUI scenes to AppKit ownership. The main changes are:
NSApplicationentry point and delegate-owned lifecycle.MenuBarControllerusingNSStatusItem,NSPopover, and hosted SwiftUI content.Confidence Score: 4/5
The app lifecycle change looks contained, but the new compatibility gate can miss broken embedded binaries.
scripts/verify_macos_compatibility.py
Important Files Changed
NSApplicationmain.Reviews (1): Last reviewed commit: "Fix launch compatibility on macOS 14 and..." | Re-trigger Greptile