Kentzo / ShortcutRecorder

The best control to record shortcuts on macOS, written in ObjC with Swift in mind
Other
575 stars 115 forks source link

Xcode 14 compatibility #149

Open mangerlahn opened 2 years ago

mangerlahn commented 2 years ago

We moved to Xcode 14 and are seeing some compatibility issues with ShortcutRecorder. Xcode 14 seems to require macOS 10.13 as deployment target. So the first question is whether the deployment target should be moved from 10.11 to 10.13. This also affects the Swift Package: https://developer.apple.com/documentation/packagedescription/supportedplatform/macosversion/v10_11

Once the deployment target is set, several deprecation warnings appear around os_trace calls. Most of them could be replaced with near identical calls to OSLog, introduced in 10.12. However this framework serves a slightly different purpose and lacks support for payload calls like os_trace_debug_with_payload. According to https://mackuba.eu/notes/wwdc14/using-activity-tracing/ some of these tracing methods became unreliable or stopped working anyways so it is debatable whether they still add value to the code.

We had issues with our CI due to the changes in Xcode 14, so for now I moved all calls to OSLog and commented out the payload functions. If you would like to raise the deployment target, I am happy to open a PR with the changes discussed here. If you would like to take a look at the affected code, you can check out my commit here.

Kentzo commented 2 years ago

Ideally I'd prefer to drop the deprecated APIs together with adding and refining codebase using new APIs.

My plan was to have first class support for Catalyst, SwiftUI and i*OS. But no ETA for this.

mangerlahn commented 2 years ago

Ok, so moving to 10.13 seems sensible then. OSLog is available on iOS and macOS, so it could be used as replacement for most of the tracing functions. Not sure about the payload stuff though. Logging or simple code deletion?

Kentzo commented 2 years ago

TBH I'm behind current best practices for tracing. Perhaps those APIs were replaced with something new from Instruments.app?