Skip to content

feat: Add SentrySPM compile-from-source product and multi-platform sample apps#7430

Open
philprime wants to merge 6 commits intomainfrom
philprime/spm-sample
Open

feat: Add SentrySPM compile-from-source product and multi-platform sample apps#7430
philprime wants to merge 6 commits intomainfrom
philprime/spm-sample

Conversation

@philprime
Copy link
Member

@philprime philprime commented Feb 11, 2026

Summary

  • Adds a new SentrySPM SPM product that compiles Sentry directly from source via a thin Swift wrapper module (Sources/SentrySPM/) using @_exported import, so consumers only need import SentrySPM
  • Restructures the compile-from-source targets: renames SentryObjc to SentryObjCInternal (reserving SentryObjC for a future public wrapper), adds extensive inline documentation in Package.swift
  • Adds SwiftUI sample apps for all supported platforms (iOS, watchOS, tvOS, macOS, visionOS) using SentrySPM with XcodeGen specs, Makefile build targets, and CI workflow integration

Architecture

SentryHeaders      → public ObjC headers (Sources/Sentry/Public/)
_SentryPrivate     → internal ObjC headers (Sources/Sentry/include/)
SentrySwift        → all Swift source (Sources/Swift/)
SentryObjCInternal → all ObjC/C source (Sources/Sentry/, Sources/SentryCrash/)
SentrySPM          → thin re-export wrapper (@_exported import of ObjC + Swift)

Test plan

  • CI builds all five platform sample apps (iOS, watchOS, tvOS, macOS, visionOS) via build-sample-spm matrix job
  • Verify make build-sample-iOS-SwiftUI-SPM succeeds locally
  • Verify existing SPM/xcframework products are unaffected
  • Verify import SentrySPM provides access to both ObjC types (SentrySDK, Breadcrumb) and Swift types (.sentryTrace())

#skip-changelog

Closes #7431

…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.
@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 822836d

@philprime philprime self-assigned this Feb 11, 2026
@philprime philprime added the ready-to-merge Use this label to trigger all PR workflows label Feb 11, 2026
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.321%. Comparing base (b9e1a29) to head (822836d).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #7430       +/-   ##
=============================================
+ Coverage   85.301%   85.321%   +0.020%     
=============================================
  Files          480       480               
  Lines        28621     28620        -1     
  Branches     12383     12385        +2     
=============================================
+ Hits         24414     24419        +5     
+ Misses        4157      4154        -3     
+ Partials        50        47        -3     

see 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9e1a29...822836d. Read the comment docs.

@philprime
Copy link
Member Author

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
@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1228.68 ms 1259.87 ms 31.19 ms
Size 24.14 KiB 1.11 MiB 1.09 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
79e2bb8 1216.37 ms 1242.42 ms 26.05 ms
a180235 1222.87 ms 1255.10 ms 32.23 ms
4b41eee 1209.96 ms 1243.12 ms 33.16 ms
3bff9ff 1217.72 ms 1246.43 ms 28.71 ms
24ac927 1218.04 ms 1242.02 ms 23.98 ms
870ddae 1224.24 ms 1249.45 ms 25.21 ms
79cee27 1214.65 ms 1238.66 ms 24.01 ms
0e4b033 1203.74 ms 1249.71 ms 45.97 ms
47c9f79 1216.57 ms 1240.94 ms 24.37 ms
c796e6d 1226.33 ms 1247.33 ms 21.00 ms

App size

Revision Plain With Sentry Diff
79e2bb8 24.14 KiB 1.04 MiB 1.02 MiB
a180235 24.14 KiB 1.11 MiB 1.09 MiB
4b41eee 24.14 KiB 1.09 MiB 1.07 MiB
3bff9ff 24.14 KiB 1.11 MiB 1.09 MiB
24ac927 24.14 KiB 1.06 MiB 1.04 MiB
870ddae 24.14 KiB 1.10 MiB 1.08 MiB
79cee27 24.14 KiB 1.10 MiB 1.08 MiB
0e4b033 24.14 KiB 1.11 MiB 1.09 MiB
47c9f79 24.14 KiB 1.09 MiB 1.06 MiB
c796e6d 24.14 KiB 1.11 MiB 1.09 MiB

Previous results on branch: philprime/spm-sample

Startup times

Revision Plain With Sentry Diff
7c06d0a 1188.40 ms 1210.33 ms 21.94 ms
becdd0e 1228.96 ms 1257.13 ms 28.17 ms
4a23cfb 1226.64 ms 1252.13 ms 25.50 ms

App size

Revision Plain With Sentry Diff
7c06d0a 24.14 KiB 1.11 MiB 1.09 MiB
becdd0e 24.14 KiB 1.11 MiB 1.09 MiB
4a23cfb 24.14 KiB 1.11 MiB 1.09 MiB

Copy link

@cursor cursor bot left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add SentrySPM compile-from-source product and multi-platform sample apps

3 participants