Skip to content

feat(ios): Consume sentry-cocoa as a prebuilt xcframework by default#6413

Draft
alwx wants to merge 1 commit into
mainfrom
alwx/feature/xcframework-by-default
Draft

feat(ios): Consume sentry-cocoa as a prebuilt xcframework by default#6413
alwx wants to merge 1 commit into
mainfrom
alwx/feature/xcframework-by-default

Conversation

@alwx

@alwx alwx commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Enhancement

📜 Description

Retry of #6381, which was merged into the release/8.18.0-alpha.3 cut prematurely and then rolled back via #6412. Content re-applied, this time with the pnpm-isolated cache-location fix baked in from the start and validated end-to-end via 8.18.0-alpha.3 on a real bare RN app + EAS Build.

pod install now downloads Sentry.xcframework.zip from sentry-cocoa's GitHub release (SHA256-verified) and caches it under ~/Library/Caches/sentry-react-native/xcframeworks/<version>/, instead of building Sentry from source as a CocoaPod. Sentry symbols are then statically linked into the app binary (no framework embed, no dylib dep) via FRAMEWORK_SEARCH_PATHS[sdk=…*] + clang's -fmodules-autolink.

Override with:

  • SENTRY_USE_XCFRAMEWORK=0 — fall back to the source-built Sentry CocoaPod (for offline builds, restrictive proxies, or projects with another pod that transitively depends on the Sentry CocoaPod).
  • SENTRY_XCFRAMEWORK_CACHE_DIR — override cache root (defaults to ~/Library/Caches/sentry-react-native/xcframeworks).

💡 Motivation and Context

  • CocoaPods trunk is winding down; we needed a path off it that also sidesteps the Xcode 16/26 archive bug that hits any signed SPM binary xcframework (Signatures/*.signature collision).
  • Consuming the same xcframework via CocoaPods' vendored_frameworks pipeline goes through a different code path and is unaffected by that bug.
  • Cache location is user-writable (not inside node_modules) so pnpm's isolated store and Yarn PnP work without changes.

💚 How did you test it?

Full validation matrix ran against 8.18.0-alpha.3 before this retry:

# Scenario Result
1 Symbolication (native crash → dSYM → Sentry frames resolved)
2 pnpm strict / read-only node_modules (--config.node-linker=isolated)
3 RN 0.71 e2e xcodebuild archive
4 EAS Build + npm + default xcframework path ✅ (a076778d)
5 EAS Build + pnpm-isolated + xcframework ✅ (c4bbee12)
6 EAS Build + SENTRY_USE_XCFRAMEWORK=0 fallback ✅ (b6acabf9)
7 EAS second-build after version bump ✅ (c9c4d591)
8 Signed device archive (AppStore distribution profile, codesign --deep --strict passes)

Static linkage confirmed empirically on every artifact:

Frameworks/               ← no Sentry.framework embedded
otool -L SentryTestApp    ← no Sentry dylib dep
nm SentryTestApp          ← Sentry symbols statically merged into the app binary

📝 Checklist

  • I updated the docs if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

  • Cut a fresh alpha from this branch once CI is green.
  • Optionally submit the signed .ipa to TestFlight to close the loop with Apple's server-side validation (not blocking).

pod install now downloads Sentry.xcframework.zip from sentry-cocoa's
GitHub release (SHA256-verified) and caches it under
~/Library/Caches/sentry-react-native/xcframeworks/<version>/, instead of
building Sentry from source as a CocoaPod. Sentry symbols are then
statically linked into the app binary (no framework embed, no dylib
dep) via `FRAMEWORK_SEARCH_PATHS[sdk=…*]` + clang's -fmodules-autolink.

Motivation:
 - CocoaPods trunk is winding down; we needed a path off it that also
   sidesteps the Xcode 16/26 archive bug that hits any signed SPM
   binary xcframework (`Signatures/*.signature` collision).
 - Consuming via CocoaPods' `vendored_frameworks` pipeline goes
   through a different code path and is unaffected.

Fallback: set `SENTRY_USE_XCFRAMEWORK=0` before pod install to restore
the source-built `Sentry` CocoaPod (for offline builds behind a
restrictive proxy, or projects with another pod that transitively
depends on the Sentry CocoaPod).

Cache location is user-writable (not inside node_modules), which
means pnpm's isolated store and Yarn PnP work without changes.
Override the cache root with `SENTRY_XCFRAMEWORK_CACHE_DIR`.

Verified end-to-end against alpha.3 on:
 - Real device signed archive (Apple accepts, codesign strict-verify passes)
 - Native crash → dSYM upload → Sentry frames symbolicated
 - RN 0.71 archive (via SKIP_BUNDLING) with 21k Sentry symbols in dSYM
 - EAS Build with npm, pnpm-isolated, and `SENTRY_USE_XCFRAMEWORK=0`
 - Second EAS build after version bump (no stale-cache pollution)

Reapplies the content of PR #6381 (merged prematurely as part of the
alpha.3 release, then rolled back via #6412) with the pnpm cache-location
fix baked in from the start this time.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

None (no version bump detected)

📋 Changelog Preview

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


  • feat(ios): Consume sentry-cocoa as a prebuilt xcframework by default by alwx in #6413

🤖 This preview updates automatically when you update the PR.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Consume sentry-cocoa as a prebuilt xcframework by default ([#6413](https://github.com/getsentry/sentry-react-native/pull/6413))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 6109f6d

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant