-
-
Notifications
You must be signed in to change notification settings - Fork 378
feat: Add SentrySPM compile-from-source product and multi-platform sample apps #7430
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
base: main
Are you sure you want to change the base?
Conversation
…mple apps Add a new "SentrySPM" SPM product that allows consumers to compile Sentry directly from source, as an alternative to the pre-built xcframework binary targets. The product uses a thin Swift wrapper module (Sources/SentrySPM/) that re-exports both the ObjC and Swift modules via @_exported import, so consumers only need `import SentrySPM`. Architecture: - SentryHeaders: public ObjC headers - _SentryPrivate: internal ObjC headers - SentrySwift: all Swift source - SentryObjCInternal: all ObjC/C source (renamed from SentryObjc) - SentrySPM: thin re-export wrapper Also adds SwiftUI sample apps for all supported platforms (iOS, watchOS, tvOS, macOS, visionOS) that use the SentrySPM product with XcodeGen, along with Makefile build targets and CI workflow integration.
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7430 +/- ##
=============================================
+ Coverage 85.318% 85.817% +0.498%
=============================================
Files 480 480
Lines 28615 28620 +5
Branches 12385 12391 +6
=============================================
+ Hits 24414 24561 +147
+ Misses 4155 4010 -145
- Partials 46 49 +3 see 16 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
|
See techprimate/Flinky#92 for additional real-world sample |
- Override IOS_SIMULATOR_OS=latest and IOS_DEVICE_NAME for the build-sample-spm CI job since macos-26 runners have Xcode 26.x simulators, not 18.4/iPhone 16 Pro - Update prepare-package.sh to keep SentrySPM product in the products array when --remove-binary-targets is used, so the existing Samples/SPM project can resolve its SentrySPM dependency during workspace builds
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 59981b9 | 1207.25 ms | 1240.71 ms | 33.46 ms |
| 0d145c3 | 1224.04 ms | 1255.34 ms | 31.30 ms |
| 17b7e88 | 1223.04 ms | 1253.48 ms | 30.43 ms |
| 79e2bb8 | 1216.37 ms | 1242.42 ms | 26.05 ms |
| 79cee27 | 1214.65 ms | 1238.66 ms | 24.01 ms |
| 9a34176 | 1227.24 ms | 1266.22 ms | 38.98 ms |
| 2400b80 | 1230.26 ms | 1261.19 ms | 30.93 ms |
| fd24b7c | 1222.39 ms | 1259.67 ms | 37.28 ms |
| 4402b70 | 1214.75 ms | 1252.13 ms | 37.38 ms |
| a424cf3 | 1231.36 ms | 1259.62 ms | 28.25 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 59981b9 | 24.14 KiB | 1.09 MiB | 1.06 MiB |
| 0d145c3 | 24.14 KiB | 1.07 MiB | 1.05 MiB |
| 17b7e88 | 24.14 KiB | 1.06 MiB | 1.04 MiB |
| 79e2bb8 | 24.14 KiB | 1.04 MiB | 1.02 MiB |
| 79cee27 | 24.14 KiB | 1.10 MiB | 1.08 MiB |
| 9a34176 | 24.14 KiB | 1.10 MiB | 1.07 MiB |
| 2400b80 | 24.14 KiB | 1.10 MiB | 1.07 MiB |
| fd24b7c | 24.14 KiB | 1.07 MiB | 1.04 MiB |
| 4402b70 | 24.15 KiB | 1.10 MiB | 1.08 MiB |
| a424cf3 | 24.14 KiB | 1.06 MiB | 1.04 MiB |
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.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Summary
SentrySPMSPM product that compiles Sentry directly from source via a thin Swift wrapper module (Sources/SentrySPM/) using@_exported import, so consumers only needimport SentrySPMSentryObjctoSentryObjCInternal(reservingSentryObjCfor a future public wrapper), adds extensive inline documentation inPackage.swiftSentrySPMwith XcodeGen specs, Makefile build targets, and CI workflow integrationArchitecture
Test plan
build-sample-spmmatrix jobmake build-sample-iOS-SwiftUI-SPMsucceeds locallyimport SentrySPMprovides access to both ObjC types (SentrySDK, Breadcrumb) and Swift types (.sentryTrace())#skip-changelog
Closes #7431