Skip to content

fix(ios): Keep -force_load when another pod sets OTHER_LDFLAGS[sdk=…] - #6801

Merged
antonis merged 4 commits into
mainfrom
antonis/fix/ios-force-load-otherldflags-merge
Sep 30, 2026
Merged

antonis merged 4 commits into
mainfrom
antonis/fix/ios-force-load-otherldflags-merge

Conversation

@antonis

@antonis antonis commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 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 plain
OTHER_LDFLAGS / FRAMEWORK_SEARCH_PATHS, which CocoaPods does merge. The
resolved 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:

  • Reproduced the bug: two pods setting OTHER_LDFLAGS[sdk=…] → the
    "Can't merge … Singular build setting … has different values" warning and
    both -force_load values absent from the resolved OTHER_LDFLAGS.
  • Confirmed the fix: no merge warning; xcodebuild -showBuildSettings
    resolves Sentry's -force_load for -sdk iphoneos and -sdk iphonesimulator,
    and the other pod's flag survives too.
  • Against the real podspec: pod install in RNSentryCocoaTester emits
    SENTRY_FORCE_LOAD_LDFLAGS[sdk=…] / SENTRY_FRAMEWORK_SEARCH_PATHS[sdk=…] for
    all slices (including the nested $(SENTRY_MACOS_SLICE) for macOS) and feeds
    them into the plain, mergeable keys — no warnings.

📝 Checklist

  • I added tests to verify changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.
  • No breaking changes.

🔮 Next steps

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>
@antonis antonis added the ready-to-merge Triggers the full CI test suite label Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 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).


  • fix(ios): Keep -force_load when another pod sets OTHER_LDFLAGS[sdk=…] by antonis in #6801
  • fix(android): Remove unused RNSentryReplayFragmentLifecycleTracer by antonis in #6803
  • feat(ios): Support SPM autolinking by alwx in #6784
  • chore(deps): bump brace-expansion from 1.1.18 to 1.1.21 by dependabot in #6809
  • chore(deps): bump moment from 2.30.1 to 2.31.0 by dependabot in #6808
  • chore(deps): bump undici from 6.28.0 to 6.29.0 by dependabot in #6806
  • chore(deps): update Maestro to v2.11.0 by github-actions in #6804
  • fix(ios): Preserve quoted Expo bundle script invocations by eliotgevers in #6796
  • chore(deps): bump ip-address from 10.4.0 to 10.7.2 by dependabot in #6799
  • chore(deps): bump fast-uri from 3.1.6 to 3.1.8 by dependabot in #6797
  • chore(deps): update Sentry Android Gradle Plugin to v6.23.0 by github-actions in #6798
  • build(deps): Bump fastlane to 2.240.1 to resolve rubyzip advisory by antonis in #6788
  • chore(deps): bump getsentry/craft from 2.31.0 to 2.31.2 by dependabot in #6793
  • chore(deps): bump the codeql-action group with 3 updates by dependabot in #6789
  • chore(deps): bump ruby/setup-ruby from 1.324.0 to 1.327.0 by dependabot in #6790
  • chore(deps): bump getsentry/github-workflows/updater from 3.4.0 to 3.4.1 by dependabot in #6792
  • chore(deps): bump getsentry/github-workflows/danger from 4013fc6e1aeb1be1f9d3b4d232624f0ec1afa613 to 36c729264d2edc29ebae61950c50e1e9f043ad7e by dependabot in #6791
  • chore(deps): update Cocoa SDK to v9.29.2 by github-actions in #6787
  • feat(replay): Populate trace_ids in mobile replay events by antonis in #6786
  • chore(deps): update Cocoa SDK to v9.29.1 by github-actions in #6785
  • chore(deps): update Android SDK to v8.58.0 by github-actions in #6778
  • fix(build): Prevent update-android.sh from failing on SIGPIPE by antonis in #6777
  • chore(deps): update Wizard to v8.0.0 by github-actions in #6775

🤖 This preview updates automatically when you update the PR.

Comment thread CHANGELOG.md Outdated
Comment thread packages/core/RNSentry.podspec Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sentry

sentry Bot commented Sep 29, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
Sentry RN io.sentry.reactnative.sample 8.28.0 (108) Release

⚙️ sentry-react-native Build Distribution Settings

@github-actions

Copy link
Copy Markdown
Contributor

iOS (legacy) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3851.90 ms 1228.30 ms -2623.60 ms
Size 5.15 MiB 6.93 MiB 1.78 MiB

Baseline results on branch: main

Startup times

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

@github-actions

Copy link
Copy Markdown
Contributor

iOS (new) Performance metrics 🚀

  Plain With Sentry Diff
Startup time 3873.96 ms 1239.47 ms -2634.49 ms
Size 5.15 MiB 6.93 MiB 1.78 MiB

Baseline results on branch: main

Startup times

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
antonis marked this pull request as ready for review September 29, 2026 09:50

@alwx alwx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@antonis antonis removed the ready-to-merge Triggers the full CI test suite label Sep 30, 2026
@antonis
antonis enabled auto-merge (squash) September 30, 2026 08:35
@github-actions

Copy link
Copy Markdown
Contributor
Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against 4642d13

@antonis
antonis merged commit 5920f6b into main Sep 30, 2026
53 of 69 checks passed
@antonis
antonis deleted the antonis/fix/ios-force-load-otherldflags-merge branch September 30, 2026 08:38
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.

iOS: Sentry -force_load silently dropped when another pod sets OTHER_LDFLAGS[sdk=…] in user_target_xcconfig

2 participants