Skip to content

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

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

feat: Add SentrySPM compile-from-source product and multi-platform sample apps#7430
philprime wants to merge 5 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 b4748ff

@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.817%. Comparing base (92e1256) to head (b4748ff).
⚠️ Report is 8 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@              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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 92e1256...b4748ff. 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 1188.40 ms 1210.33 ms 21.94 ms
Size 24.14 KiB 1.11 MiB 1.09 MiB

Baseline results on branch: main

Startup times

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

Previous results on branch: philprime/spm-sample

Startup times

Revision Plain With Sentry Diff
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
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