ShortcutRecorder icon indicating copy to clipboard operation
ShortcutRecorder copied to clipboard

Xcode 14 compatibility

Open mangerlahn opened this issue 3 years ago • 3 comments

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.

mangerlahn avatar Sep 20 '22 14:09 mangerlahn

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.

Kentzo avatar Sep 20 '22 21:09 Kentzo

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?

mangerlahn avatar Sep 21 '22 08:09 mangerlahn

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

Kentzo avatar Sep 21 '22 17:09 Kentzo