Skip to content

impr: remove mergeable-library metadata from dynamic xcframework - #8658

Draft
itaybre wants to merge 2 commits into
mainfrom
impr/remove-mergeable-library-metadata
Draft

impr: remove mergeable-library metadata from dynamic xcframework#8658
itaybre wants to merge 2 commits into
mainfrom
impr/remove-mergeable-library-metadata

Conversation

@itaybre

@itaybre itaybre commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the -Wl,-make_mergeable linker flag from scripts/build-xcframework-slice.sh.

This flag was added in #4381 and causes every dynamic framework slice to embed LC_ATOM_INFO metadata. This metadata is only consumed when the app links the framework with -merge_framework / MERGEABLE_LIBRARY, but SPM does not support mergeable libraries, so consumers ship this as dead weight that counts toward App Store download size.

Binary size reduction

Compared Sentry-Dynamic.xcframework built from main (old) vs this branch (new):

Slice Old New Reduction
ios-arm64 12.20 MB 3.73 MB -8.46 MB (69.3%)
ios-arm64_x86_64-simulator 23.55 MB 7.32 MB -16.22 MB (68.8%)
ios-arm64_x86_64-maccatalyst 29.05 MB 12.67 MB -16.37 MB (56.3%)
macos-arm64_x86_64 16.89 MB 5.43 MB -11.46 MB (67.8%)
tvos-arm64 10.67 MB 3.31 MB -7.36 MB (68.9%)
xros-arm64 9.23 MB 2.87 MB -6.36 MB (68.8%)
watchos-arm64_arm64_32 4.79 MB 4.79 MB 0 (was already excluded)

Total xcframework zip: 136 MB → 88 MB

Removing the flag does not change the runtime image — exported symbols are byte-identical, confirming LC_ATOM_INFO is link-time-only metadata. watchOS was already excluded since the watchOS linker doesn't support -make_mergeable.

Closes #8342

#skip-changelog

Test plan

  • make build-ios FOR_AGENTS=true passes
  • Verified built xcframework no longer contains LC_ATOM_INFO via otool -l
  • Verified watchOS slice is unchanged (was already excluded)

itaybre added 2 commits August 3, 2026 12:48
Remove the `-Wl,-make_mergeable` linker flag from the xcframework
build script. This flag added LC_ATOM_INFO metadata (~7.6 MB per
arm64 slice, ~71% of the binary) that is only useful when consumers
link with `-merge_framework`, which SPM does not support.
@itaybre itaybre added the run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request label Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1219.10 ms 1252.61 ms 33.51 ms
Size 24.14 KiB 1.26 MiB 1.23 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4d144d7 1225.77 ms 1255.85 ms 30.09 ms
36c25b3 1229.10 ms 1255.83 ms 26.73 ms
cf226b0 1217.35 ms 1254.55 ms 37.20 ms
bcff6b6 1234.67 ms 1272.73 ms 38.06 ms
dde298d 1212.13 ms 1247.89 ms 35.76 ms
6fd3f23 1231.84 ms 1261.43 ms 29.59 ms
b3f356a 1204.00 ms 1250.07 ms 46.07 ms
e44b6f8 1225.98 ms 1249.20 ms 23.23 ms
df67624 1225.12 ms 1259.90 ms 34.78 ms
d98d6a8 1219.69 ms 1255.85 ms 36.16 ms

App size

Revision Plain With Sentry Diff
4d144d7 24.14 KiB 1.17 MiB 1.15 MiB
36c25b3 24.14 KiB 1.18 MiB 1.16 MiB
cf226b0 24.14 KiB 1.24 MiB 1.21 MiB
bcff6b6 24.14 KiB 1.23 MiB 1.20 MiB
dde298d 24.14 KiB 1.22 MiB 1.20 MiB
6fd3f23 24.14 KiB 1.22 MiB 1.20 MiB
b3f356a 24.14 KiB 1.26 MiB 1.23 MiB
e44b6f8 24.14 KiB 1.15 MiB 1.13 MiB
df67624 24.14 KiB 1.14 MiB 1.12 MiB
d98d6a8 24.14 KiB 1.23 MiB 1.20 MiB

Previous results on branch: impr/remove-mergeable-library-metadata

Startup times

Revision Plain With Sentry Diff
bc290f4 1227.42 ms 1264.73 ms 37.31 ms

App size

Revision Plain With Sentry Diff
bc290f4 24.14 KiB 1.26 MiB 1.23 MiB

@itaybre
itaybre marked this pull request as ready for review August 3, 2026 18:01
@@ -83,12 +83,6 @@ fi

rm -rf XCFrameworkBuildPath/DerivedData

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

h: I understand that SPM is not supporting mergeable libraries, but these Xcode Frameworks are also consumed directly downloaded from GitHub Releases. Is this change going to break customer build scripts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If someone is downloading the xcframework with the intention of using it as a mergeable library, this would be a breaking change. I don't think we have any way to measure how many users are doing this.

We can wait until v10 if you believe there are users using it as mergeable

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe it would be best-practice to do so.

@itaybre
itaybre marked this pull request as draft August 4, 2026 18:02
@github-actions github-actions Bot removed the approved label Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-full-ci Allows gated GitHub Action workflows to run for a labelled pull request v10 Change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sentry-Dynamic.xcframework ships ~7.6 MB of unused mergeable-library metadata (LC_ATOM_INFO) for non-merging consumers

3 participants