fix(mac): target macOS 14 so the menubar app runs on Sonoma#577
fix(mac): target macOS 14 so the menubar app runs on Sonoma#577YoungYo wants to merge 2 commits into
Conversation
The packaged app set Package.swift to .macOS(.v15), producing a binary with minos 15.0 that LaunchServices refuses on macOS 14.x with kLSIncompatibleSystemVersionErr (-10825) — even though Info.plist, the CLI install guard (MIN_MACOS_MAJOR=14), and the README all advertise macOS 14+. The .v15 bump was attributed to NSAttributedString(attachment:), which is actually AppKit since macOS 10.0, so the floor must not exclude Sonoma. Separately, a stock macOS-15-SDK CI build hard-links libswift_errno.dylib (macOS 15 only), which dyld cannot resolve on Sonoma even once minos passes. Building against the macOS 14 SDK avoids that dependency. - Package.swift: .macOS(.v15) -> .macOS(.v14) - Scripts/build-local.sh: build on a Sonoma machine (which only has the macOS 14 SDK, lacking the SwiftUI @mainactor inference the macOS 15 SDK adds to the View protocol) using a standalone swift.org Swift 6.x toolchain, patching @mainactor onto views in a scratch copy so repo sources stay clean. - README: document the Sonoma local-build path. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Reviewed this in depth, including reproducing the Mach-O layout locally and checking the linker mechanism against Apple's ld64. Net: the diagnosis is correct, and the one-line manifest change is the right fix and is sufficient for the CI-distributed release too, not just local builds. Notes below are about the wording of the description (the mechanism is the deployment target, not the SDK) plus an optional guard to keep this from regressing. 1. Root cause confirmed
2. The manifest change is sufficient, including for CI (one correction to the description)The "deeper layer" note says a stock macOS-15-SDK build hard-links I built the target two ways against a newer SDK (macOS 26.5 SDK, Swift 6.3.2, no source patches), the same "newer SDK than the floor" situation CI is in: The mechanism is CI runs on Worth noting the inverse: pinning 3. Implication for
|
…eployment-target wording, universal build-local.sh, CI minos guard - README.md / build-local.sh: the -10825 fix is the Package.swift deployment target, not the SDK used to build (ld64's $ld$previous drops libswift_errno.dylib based on minos, so it already applies to the CI-distributed release too). build-local.sh exists only for building on a Sonoma machine with just the Command Line Tools. - build-local.sh: build arm64 and x86_64 separately and lipo them into a universal binary (`--arch arm64 --arch x86_64` together needs xcbuild, which CLT doesn't ship); assert the active SDK is actually 14.x instead of silently trusting `xcrun`; use `pkill -x` instead of `-f` to avoid matching unrelated processes; broaden the @mainactor patch regex to slurp mode so it also covers multi-line struct headers and `extension X: View`. - package-app.sh: fail the build if the packaged binary's minos isn't 14.0 for every arch slice, or if it links libswift_errno.dylib, so a future deployment-target regression is caught in CI instead of a user's crash report. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Thanks for the deep dive — the 1. Wording fix — you're right, 2.
3. Ran the full |
Problem
codeburn menubarfails on macOS 14.x (Sonoma) with:The released
.app's Mach-O hasminos = 15.0, so LaunchServices rejects it on Sonoma — even thoughInfo.plist(LSMinimumSystemVersion = 14.0), the CLI install guard (MIN_MACOS_MAJOR = 14), andmac/READMEall advertise macOS 14+.Root cause
mac/Package.swiftdeclared.macOS(.v15). That commit's rationale wasNSAttributedString(attachment:), but that initializer is AppKit since macOS 10.0 — the bump was a misdiagnosis.Package.swiftwas the only place claiming 15; everything else says 14.There's also a deeper layer: a stock macOS-15-SDK build hard-links
/usr/lib/swift/libswift_errno.dylib, which only ships in macOS 15. Even after patchingminos, dyld can't resolve it on Sonoma. Building against the macOS 14 SDK avoids that dependency entirely.Changes
Package.swift:.macOS(.v15)→.macOS(.v14)— the actual fix. Binaryminosbecomes14.0, matching every other declaration. No macOS 15-only API is used.Scripts/build-local.sh(new): build on a Sonoma machine. The macOS 14 SDK's SwiftUI lacks the@MainActorannotation the macOS 15 SDK adds to theViewprotocol, so a plain build hits ~80 actor-isolation errors. The script uses a standalone swift.org Swift 6.x toolchain against the local 14 SDK and adds explicit@MainActorto views in a scratch copy (repo sources stay clean), producing aminos = 14.0bundle in~/Applications.README.md: document the Sonoma local-build path.Verification
Built locally on macOS 14.3 (arm64) via
build-local.sh:The
-10825error is gone and the menubar app launches normally.🤖 Generated with Claude Code