Skip to content

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

@dcharkes

Description

@dcharkes

Currently the the dynamic libraries from build hooks are bundled as is.

On Android and iOS we should run some compiler commands to strip them from debug symbols to reduce code size and provide the symbol files on the side.

  • Android: objcopy --only-keep-debug libmylib.so libmylib.so.sym + strip --strip-debug --strip-unneeded libmylib.so + objcopy --add-gnu-debuglink=libmylib.so.sym libmylib.so.
  • iOS: symutil libmylib.dylib + strip -x -S libmylib.dylib

For iOS we have code signing logic on copying. That would probably the right place to strip the symbols as well:

For Android, we can add the stripping also just before the copying:

Thanks for the suggestion @mraleph!

(Note: since the debug symbols can be stripped by the SDK invoking the build hooks, we don't provide anything the build hooks itself to allow for reporting debug symbols in a separate file.)

Metadata

Metadata

Assignees

Labels

a: buildBuilding flutter applications with the toolc: proposalA detailed proposal for a change to Flutterteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions