-
Notifications
You must be signed in to change notification settings - Fork 116
Fix macOS 13 compatibility #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove asyncAndWait which is unavailable on macOS < 14. Using sync instead, which has equivalent behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a crash on macOS 13 by replacing an API that's only available on macOS 14+ with a backward-compatible equivalent. The issue was that asyncAndWait caused dyld to crash at launch on macOS 13 due to hard-linking of unavailable symbols, even when guarded with availability checks.
Key Changes:
- Replace
DispatchQueue.main.asyncAndWait(execute:)withDispatchQueue.main.sync(execute:)which has identical behavior and is available on macOS 13+
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
asyncAndWaitwithsyncto fix crash on macOS 13Problem
DispatchQueue.asyncAndWait(execute:)is only available on macOS 14+. Using#availablecheck doesn't help because the symbol is still hard-linked in the binary, causing dyld to crash at launch on older systems:Solution
Use
DispatchQueue.main.sync(execute:)instead, which has equivalent behavior and is available on all macOS versions.