getsentry / sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
https://sentry.io/for/cocoa/
MIT License
807 stars 317 forks source link

Specify better `-destination` in `build-xcframework.sh` #4153

Open armcknight opened 3 months ago

armcknight commented 3 months ago

Description

currently we specify the -sdk to xcodebuild, but this is a fragile approach and should be replaced with -destination. Currently, it is warning that it will choose the first from a set of possible destinations, and this can sometimes lead to it choosing the wrong one. I've seen this happen when it chooses a macOS destination when building for iOS, and also choosing the wrong macOS architecture (x86_64 vs arm64).

https://github.com/getsentry/sentry-cocoa/actions/runs/9866174689/job/27244481851#step:3:3981

image
brustolin commented 3 months ago

For macOS catalyst we use -destination and the same warning appears. I believe the solution should involve a query for the specific SDK before compiling it, to ensure the desire destination exists.