Repository navigation
fix(ios): Keep -force_load when another pod sets OTHER_LDFLAGS[sdk=…] - #6801
Merged
Merged
Conversation
The podspec wrote Sentry's -force_load into `OTHER_LDFLAGS[sdk=…]` (and the xcframework search paths into `FRAMEWORK_SEARCH_PATHS[sdk=…]`) in `user_target_xcconfig`. CocoaPods only concatenates `user_target_xcconfig` across pods for keys in its `PLURAL_SETTINGS` list, matched by exact key: the bare `OTHER_LDFLAGS`/`FRAMEWORK_SEARCH_PATHS` qualify, their `[sdk=…]` conditional forms do not. So when another pod (e.g. react-native-executorch) also set `OTHER_LDFLAGS[sdk=…]` with a different value, CocoaPods treated it as a singular setting, kept neither value, and only warned — silently dropping Sentry's force-load and leaving ObjC-category/Swift-only symbols to be dead-stripped and crash at runtime with "unrecognized selector". Carry the SDK-conditional values on Sentry-private variables (`SENTRY_FORCE_LOAD_LDFLAGS`, `SENTRY_FRAMEWORK_SEARCH_PATHS`) that no other pod sets, and reference them from the plain `OTHER_LDFLAGS`/`FRAMEWORK_SEARCH_PATHS` that CocoaPods does merge. Fixes #6800 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
antonis
commented
Sep 29, 2026
antonis
commented
Sep 29, 2026
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c2c2552. Configure here.
📲 Install BuildsAndroid
|
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0a9e622+dirty | 3835.87 ms | 1221.07 ms | -2614.80 ms |
| 7d6fd3a+dirty | 1223.29 ms | 1229.57 ms | 6.28 ms |
| 5ca03f9+dirty | 3844.55 ms | 1218.36 ms | -2626.19 ms |
| 774257e+dirty | 3846.90 ms | 1215.02 ms | -2631.88 ms |
| 40c9884+dirty | 3837.72 ms | 1226.61 ms | -2611.11 ms |
| 4e0b819+dirty | 3839.05 ms | 1210.75 ms | -2628.30 ms |
| d038a14+dirty | 3845.71 ms | 1228.11 ms | -2617.59 ms |
| 57e0069+dirty | 3842.29 ms | 1212.12 ms | -2630.17 ms |
| 882f8ae+dirty | 3840.30 ms | 1224.41 ms | -2615.88 ms |
| 5125c43+dirty | 3846.45 ms | 1221.12 ms | -2625.32 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0a9e622+dirty | 4.98 MiB | 6.51 MiB | 1.53 MiB |
| 7d6fd3a+dirty | 3.38 MiB | 4.77 MiB | 1.39 MiB |
| 5ca03f9+dirty | 4.98 MiB | 6.53 MiB | 1.55 MiB |
| 774257e+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 40c9884+dirty | 4.98 MiB | 6.51 MiB | 1.53 MiB |
| 4e0b819+dirty | 4.98 MiB | 6.46 MiB | 1.49 MiB |
| d038a14+dirty | 5.15 MiB | 6.67 MiB | 1.51 MiB |
| 57e0069+dirty | 4.98 MiB | 6.50 MiB | 1.52 MiB |
| 882f8ae+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 5125c43+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 9253345+dirty | 3862.73 ms | 1237.15 ms | -2625.59 ms |
| ef27341+dirty | 3835.20 ms | 1212.23 ms | -2622.97 ms |
| d387874+dirty | 3838.71 ms | 1211.11 ms | -2627.60 ms |
| 4acd4e9+dirty | 3806.73 ms | 1208.48 ms | -2598.25 ms |
| 0b1b5e3+dirty | 3820.72 ms | 1207.94 ms | -2612.78 ms |
| 267d3ed+dirty | 3860.14 ms | 1223.39 ms | -2636.76 ms |
| 853723c+dirty | 3849.33 ms | 1221.07 ms | -2628.26 ms |
| b726ced+dirty | 3840.50 ms | 1217.29 ms | -2623.21 ms |
| 9474ead+dirty | 3823.33 ms | 1208.31 ms | -2615.03 ms |
| 3d377b5+dirty | 1201.55 ms | 1201.80 ms | 0.25 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 9253345+dirty | 5.15 MiB | 6.89 MiB | 1.74 MiB |
| ef27341+dirty | 5.15 MiB | 6.68 MiB | 1.53 MiB |
| d387874+dirty | 5.08 MiB | 6.68 MiB | 1.60 MiB |
| 4acd4e9+dirty | 4.98 MiB | 6.53 MiB | 1.55 MiB |
| 0b1b5e3+dirty | 5.15 MiB | 6.70 MiB | 1.54 MiB |
| 267d3ed+dirty | 5.15 MiB | 6.69 MiB | 1.54 MiB |
| 853723c+dirty | 5.15 MiB | 6.69 MiB | 1.53 MiB |
| b726ced+dirty | 5.15 MiB | 6.89 MiB | 1.74 MiB |
| 9474ead+dirty | 5.15 MiB | 6.71 MiB | 1.55 MiB |
| 3d377b5+dirty | 3.38 MiB | 4.76 MiB | 1.38 MiB |
antonis
marked this pull request as ready for review
September 29, 2026 09:50
antonis
enabled auto-merge (squash)
September 30, 2026 08:35
Contributor
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📢 Type of change
📜 Description
This change routes the SDK-conditional values through Sentry-private variables
that no other pod sets (
SENTRY_FORCE_LOAD_LDFLAGS,SENTRY_FRAMEWORK_SEARCH_PATHS) and references them from the plainOTHER_LDFLAGS/FRAMEWORK_SEARCH_PATHS, which CocoaPods does merge. Theresolved flags are unchanged for apps without a conflicting pod.
💡 Motivation and Context
Fixes #6800.
💚 How did you test it?
Verified with the real CocoaPods 1.16.2 merge, both in a minimal two-pod
reproduction and against the actual podspec:
OTHER_LDFLAGS[sdk=…]→ the"Can't merge … Singular build setting … has different values" warning and
both
-force_loadvalues absent from the resolvedOTHER_LDFLAGS.xcodebuild -showBuildSettingsresolves Sentry's
-force_loadfor-sdk iphoneosand-sdk iphonesimulator,and the other pod's flag survives too.
pod installinRNSentryCocoaTesteremitsSENTRY_FORCE_LOAD_LDFLAGS[sdk=…]/SENTRY_FRAMEWORK_SEARCH_PATHS[sdk=…]forall slices (including the nested
$(SENTRY_MACOS_SLICE)for macOS) and feedsthem into the plain, mergeable keys — no warnings.
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps