-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Changes from all commits
9073f9e
459d0e1
8021b77
2f89a5c
d7667e2
a183604
abc045e
5902129
e051e84
2e805ea
8cd392f
b8662f9
f974931
b07073e
f4745cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Build Native Dependencies | ||
runs: | ||
using: composite | ||
|
||
steps: | ||
|
||
- 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 | ||
Comment on lines
+7
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (The Carthage submodule is tracking their There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 However it is done, ultimately we need the build output to look like the following to bind correctly in .NET:
We get that by using Only reason this matters is because .NET MAUI uses Mac Catalyst to build macOS apps. |
||
|
||
- name: Fetch version tags for Sentry Cocoa SDK | ||
shell: bash | ||
run: git fetch --tags --quiet | ||
working-directory: modules/sentry-cocoa | ||
|
||
- name: Get Sentry Cocoa SHA | ||
shell: bash | ||
run: echo "SENTRY_COCOA_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
working-directory: modules/sentry-cocoa | ||
|
||
- name: Cache Sentry Cocoa SDK | ||
id: cache-sentry-cocoa | ||
uses: actions/cache@v3 | ||
with: | ||
path: modules/sentry-cocoa/Carthage/Build | ||
key: sentry-cocoa-${{ env.SENTRY_COCOA_SHA }} | ||
|
||
- name: Build Sentry Cocoa SDK | ||
if: ${{ steps.cache-sentry-cocoa.outputs.cache-hit != 'true' }} | ||
shell: bash | ||
run: scripts/build-sentry-cocoa.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
[submodule "modules/Ben.Demystifier"] | ||
path = modules/Ben.Demystifier | ||
url = https://github.com/getsentry/Ben.Demystifier | ||
[submodule "modules/sentry-cocoa"] | ||
path = modules/sentry-cocoa | ||
url = https://github.com/getsentry/sentry-cocoa.git | ||
[submodule "modules/Carthage"] | ||
path = modules/Carthage | ||
url = https://github.com/Carthage/Carthage | ||
branch = xcframework-catalyst |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
pushd "$(dirname "$0")" > /dev/null | ||
cd ../modules | ||
|
||
# We need a custom build of Carthage that supports building XCFrameworks for Mac Catalyst, | ||
# so we'll bring it in as a submodule and build it here. | ||
# See https://github.com/getsentry/sentry-cocoa/issues/2031 | ||
# and https://github.com/Carthage/Carthage/pull/3235 | ||
|
||
CARTHAGE=Carthage/.build/debug/carthage | ||
|
||
if [ ! -f $CARTHAGE ]; then | ||
cd Carthage | ||
echo "---------- Building Carthage ---------- " | ||
make all | ||
echo "" | ||
cd .. | ||
fi | ||
|
||
if [ $? -eq 0 ] | ||
then | ||
cd sentry-cocoa | ||
|
||
# Keep track of the submodule's SHA so we only build when we need to | ||
SHA=$(git rev-parse HEAD) | ||
SHAFILE=Carthage/Build/.built-from-sha | ||
[ -f $SHAFILE ] && SHAFROMFILE=$(<$SHAFILE) | ||
VERSION="$(git describe --tags) ($(git rev-parse --short HEAD))" | ||
|
||
if [ "$SHA" == "$SHAFROMFILE" ]; then | ||
echo "Sentry Cocoa SDK $VERSION was already built" | ||
else | ||
echo "---------- Building Sentry Cocoa SDK $VERSION ---------- " | ||
rm -rf Carthage | ||
../$CARTHAGE build --use-xcframeworks --no-skip-current --platform ios,macCatalyst | ||
echo $SHA > $SHAFILE | ||
echo "" | ||
fi | ||
|
||
cd .. | ||
fi | ||
|
||
popd > /dev/null |
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.