Skip to content

[native assets] Split debug info into .dsym files#181533

Merged
auto-submit[bot] merged 1 commit into
masterfrom
code-assets-dsym
Jan 30, 2026
Merged

[native assets] Split debug info into .dsym files#181533
auto-submit[bot] merged 1 commit into
masterfrom
code-assets-dsym

Conversation

@dcharkes

Copy link
Copy Markdown
Contributor

This PR splits the debug info from code assets into separate dsym files for MacOS and iOS.

The splitting only happens if the build mode is not debug. This aligns with whether the debug symbols are separated out for the Flutter framework and the app Framework.

Closes: #181377

Testing: Added some tests to the integration test

@dcharkes dcharkes requested a review from a team as a code owner January 27, 2026 09:59
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. a: desktop Running on desktop team-ios Owned by iOS platform team labels Jan 27, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces functionality to split debug information from native code assets into separate .dsym files for macOS and iOS, and to strip the dylibs for non-debug builds. This aligns with standard release build practices to reduce binary size while retaining debuggability via dSYM files. New utility functions dsymutilDylib and stripDylib have been added to handle these operations, along with corresponding integration tests to verify the behavior. The changes are well-documented and logically applied.

Comment thread packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart Outdated
Comment thread packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart Outdated

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

LGTM!

@vashworth

Copy link
Copy Markdown
Contributor

I tried this out, and it does not put the dsym in the right place and will lead to App Store failure:

Screenshot 2026-01-28 at 8 22 26 PM

The dSYM needs to be copied to the BUILT_PRODUCTS_DIR. It should not be within framework itself

'dsymutil',
dylibFile.path,
'-o',
dsymPath,

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.

See comment: #181533 (comment)

This likely needs to be changed to output to somewhere outside of the framework, and then copied into the BUILT_PRODUCTS_DIR, likely in xcode_backend.dart

@dcharkes

Copy link
Copy Markdown
Contributor Author

Okay, a separate dsym framework for the DWARF file, and output to the BUILT_PRODUCTS_DIR instead of inside the .app. It looks like now it's the same as the Flutter framework:

image

@vashworth

Copy link
Copy Markdown
Contributor

test/general.shard/xcode_backend_test.dart needs to be updated

@vashworth

Copy link
Copy Markdown
Contributor

Also, the stripping does not change correctly when switching between build modes. If you do

flutter build ios --debug
otool -l /path/to/my_app/build/native_assets/ios/my_ffi_plugin.framework/my_ffi_plugin -> LC_DYSYMTAB nlocalsym > 1 as expected

then do

flutter build ios --release
otool -l /path/to/my_app/build/native_assets/ios/my_ffi_plugin.framework/my_ffi_plugin -> LC_DYSYMTAB nlocalsym == 1 as expected

then do

flutter build ios --debug
otool -l /path/to/my_app/build/native_assets/ios/my_ffi_plugin.framework/my_ffi_plugin -> LC_DYSYMTAB nlocalsym is NOT > 1 as expected ❌

@dcharkes

Copy link
Copy Markdown
Contributor Author

Also, the stripping does not change correctly when switching between build modes. If you do

flutter build ios --debug otool -l /path/to/my_app/build/native_assets/ios/my_ffi_plugin.framework/my_ffi_plugin -> LC_DYSYMTAB nlocalsym > 1 as expected

then do

flutter build ios --release otool -l /path/to/my_app/build/native_assets/ios/my_ffi_plugin.framework/my_ffi_plugin -> LC_DYSYMTAB nlocalsym == 1 as expected

then do

flutter build ios --debug otool -l /path/to/my_app/build/native_assets/ios/my_ffi_plugin.framework/my_ffi_plugin -> LC_DYSYMTAB nlocalsym is NOT > 1 as expected ❌

Oh nice catch!

This is a separate issue (and is already an issue before this PR), let's address it in a separate PR. The root cause is a Target writing to a directory outside .dart_tool/flutter_build/<hash>/, while the Targets assume that if their inputs don't change their outputs don't have to change. This is most likely also an issue for code assets for Android.

@dcharkes dcharkes added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jan 30, 2026
Merged via the queue into master with commit b877bae Jan 30, 2026
147 checks passed
@auto-submit auto-submit Bot deleted the code-assets-dsym branch January 30, 2026 18:57
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 1, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Feb 2, 2026
flutter/flutter@1d9d6a9...9eafba4

2026-02-01 engine-flutter-autoroll@skia.org Roll Skia from a8ceddc2bca0 to 4ee9eb659ae0 (1 revision) (flutter/flutter#181773)
2026-02-01 engine-flutter-autoroll@skia.org Roll Skia from a5a535bc21a3 to a8ceddc2bca0 (1 revision) (flutter/flutter#181772)
2026-02-01 engine-flutter-autoroll@skia.org Roll Dart SDK from cde322c518b9 to 84abc8d58ec8 (1 revision) (flutter/flutter#181767)
2026-02-01 engine-flutter-autoroll@skia.org Roll Dart SDK from c72b3f527a07 to cde322c518b9 (1 revision) (flutter/flutter#181763)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from 43de79f08887 to c72b3f527a07 (1 revision) (flutter/flutter#181762)
2026-01-31 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 27OsrsrKcrr2pOaqY... to nI52U4LJMrBv8G1M9... (flutter/flutter#181760)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from a0aac59705e5 to 43de79f08887 (1 revision) (flutter/flutter#181758)
2026-01-31 engine-flutter-autoroll@skia.org Roll Skia from b704afbcd8e7 to a5a535bc21a3 (1 revision) (flutter/flutter#181757)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from d6f77f9098e1 to a0aac59705e5 (1 revision) (flutter/flutter#181756)
2026-01-31 engine-flutter-autoroll@skia.org Roll Skia from 6f9511ce11ba to b704afbcd8e7 (4 revisions) (flutter/flutter#181753)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from 0cf997832948 to d6f77f9098e1 (2 revisions) (flutter/flutter#181749)
2026-01-31 engine-flutter-autoroll@skia.org Roll Skia from 33c00c0f3b8b to 6f9511ce11ba (1 revision) (flutter/flutter#181744)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from be3ffc51d407 to 0cf997832948 (1 revision) (flutter/flutter#181740)
2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from b62d43b59dd6 to 33c00c0f3b8b (1 revision) (flutter/flutter#181735)
2026-01-30 jason-simmons@users.noreply.github.com [Impeller] Fix type conversion warnings seen on Windows when Impeller GL API wrappers log arguments with function types (flutter/flutter#181734)
2026-01-30 jesswon@google.com Update New Android API Docs (flutter/flutter#180604)
2026-01-30 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from isy1ARvK-3bsvtfc-... to 27OsrsrKcrr2pOaqY... (flutter/flutter#181733)
2026-01-30 nemeth@marcell.it Fix P3-to-sRGB color conversion to operate in linear light (flutter/flutter#181720)
2026-01-30 codefu@google.com chore: deflake Linux_mokey flutter_engine_group_performance (flutter/flutter#181624)
2026-01-30 engine-flutter-autoroll@skia.org Roll Dart SDK from 2703fd9733ce to be3ffc51d407 (1 revision) (flutter/flutter#181729)
2026-01-30 matt.boetger@gmail.com Ensure content-sizing resize is run on UI thread (flutter/flutter#181686)
2026-01-30 bkonyi@google.com [ Tool ] Cleanup `ResidentCompiler` initialization logic (flutter/flutter#181421)
2026-01-30 dacoharkes@google.com [native assets] Split debug info into `.dsym` files (flutter/flutter#181533)
2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from 4745eb2fe837 to b62d43b59dd6 (1 revision) (flutter/flutter#181727)
2026-01-30 planetmarshall@users.noreply.github.com add ccache support for custom toolchain (flutter/flutter#180737)
2026-01-30 planetmarshall@users.noreply.github.com update GLFW to latest and use EGL context creation on linux (flutter/flutter#181259)
2026-01-30 planetmarshall@users.noreply.github.com add stacktrace support when requested for host builds (flutter/flutter#181264)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Feb 6, 2026
This PR splits the debug info from code assets into separate dsym files
for MacOS and iOS.

The splitting only happens if the build mode is not debug. This aligns
with whether the debug symbols are separated out for the Flutter
framework and the app Framework.

Closes: flutter#181377

Testing: Added some tests to the integration test
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
This PR splits the debug info from code assets into separate dsym files
for MacOS and iOS.

The splitting only happens if the build mode is not debug. This aligns
with whether the debug symbols are separated out for the Flutter
framework and the app Framework.

Closes: flutter#181377

Testing: Added some tests to the integration test
@odedsolutions

odedsolutions commented Feb 18, 2026

Copy link
Copy Markdown

Still happening on Flutter 3.41.1.

Saw the issue above was merged, when can it be expected to be included in an update? Is there a workaround until then?

thanks for all your relentless efforts!

rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
This PR splits the debug info from code assets into separate dsym files
for MacOS and iOS.

The splitting only happens if the build mode is not debug. This aligns
with whether the debug symbols are separated out for the Flutter
framework and the app Framework.

Closes: flutter#181377

Testing: Added some tests to the integration test
@dcharkes

Copy link
Copy Markdown
Contributor Author

Saw the issue above was merged, when can it be expected to be included in an update? Is there a workaround until then?

https://github.com/flutter/flutter/blob/master/docs/releases/Flutter-build-release-channels.md explains how fixes reach stable for Flutter.

creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#10938)

flutter/flutter@1d9d6a9...9eafba4

2026-02-01 engine-flutter-autoroll@skia.org Roll Skia from a8ceddc2bca0 to 4ee9eb659ae0 (1 revision) (flutter/flutter#181773)
2026-02-01 engine-flutter-autoroll@skia.org Roll Skia from a5a535bc21a3 to a8ceddc2bca0 (1 revision) (flutter/flutter#181772)
2026-02-01 engine-flutter-autoroll@skia.org Roll Dart SDK from cde322c518b9 to 84abc8d58ec8 (1 revision) (flutter/flutter#181767)
2026-02-01 engine-flutter-autoroll@skia.org Roll Dart SDK from c72b3f527a07 to cde322c518b9 (1 revision) (flutter/flutter#181763)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from 43de79f08887 to c72b3f527a07 (1 revision) (flutter/flutter#181762)
2026-01-31 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 27OsrsrKcrr2pOaqY... to nI52U4LJMrBv8G1M9... (flutter/flutter#181760)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from a0aac59705e5 to 43de79f08887 (1 revision) (flutter/flutter#181758)
2026-01-31 engine-flutter-autoroll@skia.org Roll Skia from b704afbcd8e7 to a5a535bc21a3 (1 revision) (flutter/flutter#181757)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from d6f77f9098e1 to a0aac59705e5 (1 revision) (flutter/flutter#181756)
2026-01-31 engine-flutter-autoroll@skia.org Roll Skia from 6f9511ce11ba to b704afbcd8e7 (4 revisions) (flutter/flutter#181753)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from 0cf997832948 to d6f77f9098e1 (2 revisions) (flutter/flutter#181749)
2026-01-31 engine-flutter-autoroll@skia.org Roll Skia from 33c00c0f3b8b to 6f9511ce11ba (1 revision) (flutter/flutter#181744)
2026-01-31 engine-flutter-autoroll@skia.org Roll Dart SDK from be3ffc51d407 to 0cf997832948 (1 revision) (flutter/flutter#181740)
2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from b62d43b59dd6 to 33c00c0f3b8b (1 revision) (flutter/flutter#181735)
2026-01-30 jason-simmons@users.noreply.github.com [Impeller] Fix type conversion warnings seen on Windows when Impeller GL API wrappers log arguments with function types (flutter/flutter#181734)
2026-01-30 jesswon@google.com Update New Android API Docs (flutter/flutter#180604)
2026-01-30 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from isy1ARvK-3bsvtfc-... to 27OsrsrKcrr2pOaqY... (flutter/flutter#181733)
2026-01-30 nemeth@marcell.it Fix P3-to-sRGB color conversion to operate in linear light (flutter/flutter#181720)
2026-01-30 codefu@google.com chore: deflake Linux_mokey flutter_engine_group_performance (flutter/flutter#181624)
2026-01-30 engine-flutter-autoroll@skia.org Roll Dart SDK from 2703fd9733ce to be3ffc51d407 (1 revision) (flutter/flutter#181729)
2026-01-30 matt.boetger@gmail.com Ensure content-sizing resize is run on UI thread (flutter/flutter#181686)
2026-01-30 bkonyi@google.com [ Tool ] Cleanup `ResidentCompiler` initialization logic (flutter/flutter#181421)
2026-01-30 dacoharkes@google.com [native assets] Split debug info into `.dsym` files (flutter/flutter#181533)
2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from 4745eb2fe837 to b62d43b59dd6 (1 revision) (flutter/flutter#181727)
2026-01-30 planetmarshall@users.noreply.github.com add ccache support for custom toolchain (flutter/flutter#180737)
2026-01-30 planetmarshall@users.noreply.github.com update GLFW to latest and use EGL context creation on linux (flutter/flutter#181259)
2026-01-30 planetmarshall@users.noreply.github.com add stacktrace support when requested for host builds (flutter/flutter#181264)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[native assets] Bundle code assets debug symbols in separate dsym file

4 participants