-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Update bundled Cocoa SDK to version 7.31.1 #2053
Conversation
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.
I haven't had a proper look yet, just wondering whether it would make sense to grab what we do in Unity (and Unreal) instead:
- reusable workflow: https://github.com/getsentry/sentry-unity/blob/f3f805106695832381dbf405449f4babfa2ba3b4/.github/workflows/sdk.yml
- actual call - we would just take one, not the whole matrix - https://github.com/getsentry/sentry-unity/blob/f3f805106695832381dbf405449f4babfa2ba3b4/.github/workflows/ci.yml#L28
- name: Get Carthage SHA | ||
shell: bash | ||
run: echo "CARTHAGE_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
working-directory: modules/Carthage | ||
|
||
- name: Cache Carthage | ||
id: cache-carthage | ||
uses: actions/cache@v3 | ||
with: | ||
path: modules/Carthage/.build/debug/carthage | ||
key: carthage-${{ env.CARTHAGE_SHA }} | ||
|
||
- name: Build Carthage | ||
if: ${{ steps.cache-carthage.outputs.cache-hit != 'true' }} | ||
shell: bash | ||
run: make all | ||
working-directory: modules/Carthage |
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.
Why do we need to build Carthage? It's available on macOS
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.
It's a custom build so we can create xcframeworks for Mac Catalyst properly. See comments in the build-sentry-cocoa.sh
script. https://github.com/getsentry/sentry-dotnet/pull/2053/files#diff-6be5d334c8d46a713f0d9a5b40af751ffc613d6e52405e4a0f72fa06c2d91ed6R6-R9
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.
(The Carthage submodule is tracking their xcframework-catalyst
branch.)
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.
Happy to kill it if you can find any other solution. I figure there must be a way to skip Carthage and just use xcodebuild
, but I lack expertise in this area and couldn't figure it out.
I already looked into using either Swift SPM or CocoaPods, but the matching tooling on the Xamarin side just isn't up to par (docs talk about sharpie pod
, but that is very broken and MS doesn't seem to be in a hurry to fix it).
However it is done, ultimately we need the build output to look like the following to bind correctly in .NET:
.
└── Sentry.xcframework
├── Info.plist
├── ios-arm64
│ ├── Sentry.framework
│ └── dSYMs
├── ios-arm64_x86_64-maccatalyst
│ ├── Sentry.framework
│ └── dSYMs
└── ios-arm64_x86_64-simulator
├── Sentry.framework
└── dSYMs
We get that by using carthage build --use-xcframeworks --no-skip-current --platform ios,macCatalyst
but only when using the custom Carthage build can we ask for macCatalyst
.
Only reason this matters is because .NET MAUI uses Mac Catalyst to build macOS apps.
I took a lot of inspiration from there, but I believe this will work better for this repo. We have a few different concerns. Besides just the custom build of Carthage, we also have msbuild complexities due to multi-targeting that don't arise in the Unity SDK. Some of that you can see in this PR here: https://github.com/getsentry/sentry-dotnet/pull/2053/files#diff-71d304df430c892a78a35eb87b1dcbd39ece3e782e3900129d28c9bb559672cfR29-R35 |
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.
LGTM but if Ivan has ideas to simplify both this repo + Unity somehow, that could work too.
Otherwise, this works pretty well for .NET it seems
id: cache-carthage | ||
uses: actions/cache@v3 | ||
with: | ||
path: modules/Carthage/.build/debug/carthage |
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.
can we go without this cache since we're caching below at Cache Sentry Cocoa SDK
?
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.
I split them into separate caches because Carthage takes a very long time to build, and it's not likely we'll need to update it as often as we do the Cocoa SDK. I also restore it every time to keep it active, otherwise GHA will prune it from the cache over time.
Updates the Sentry Cocoa SDK (for iOS/MacCatalyst targets) from 7.28.0 to 7.31.1 [diff] [changelog].
Also changes how we acquire the SDK. We now use a submodule, and build it ourselves as part of building
Sentry.Bindings.Cocoa
. This should make it easier to update going forward.