Skip to content

fix(build): honour --obfuscate and --split-debug-info in tvOS AOT builds#17

Merged
DenisovAV merged 2 commits into
mainfrom
fix/obfuscate-flag-issue-10
May 28, 2026
Merged

fix(build): honour --obfuscate and --split-debug-info in tvOS AOT builds#17
DenisovAV merged 2 commits into
mainfrom
fix/obfuscate-flag-issue-10

Conversation

@MAUstaoglu
Copy link
Copy Markdown
Member

Summary

  • The tvOS AOT step runs gen_snapshot directly (not upstream AOTSnapshotter) and previously dropped --obfuscate / --split-debug-info entirely — release/profile builds completed but the App binary kept readable Dart symbols and the split-debug-info directory stayed empty.
  • The gen_snapshot invocation now forwards --obfuscate, the --dwarf-stack-traces / --resolve-dwarf-paths / --save-debugging-info=<dir>/app.ios-arm64.symbols trio, and any --extra-gen-snapshot-options, matching AOTSnapshotter.build.
  • Arg construction extracted into a testable tvosGenSnapshotArgs helper; bumped to 1.1.1.

Test plan

  • dart analyze --fatal-infos clean on changed files
  • New unit tests (test/general/tvos_aot_snapshot_test.dart) cover the flag matrix — 8/8 passing
  • Manual A/B release build of a demo app: app Dart symbols drop from present to 0 hits with the flags, and app.ios-arm64.symbols is written

Fixes #10

Copilot AI review requested due to automatic review settings May 28, 2026 12:38
@MAUstaoglu MAUstaoglu review requested due to automatic review settings May 28, 2026 12:40
The tvOS AOT step invokes gen_snapshot directly (not upstream
AOTSnapshotter) and previously dropped the obfuscation flags entirely:
release/profile builds succeeded but the App binary kept readable Dart
symbols and the --split-debug-info directory stayed empty.

Forward --obfuscate, the --dwarf-stack-traces / --resolve-dwarf-paths /
--save-debugging-info=<dir>/app.ios-arm64.symbols trio, and any
--extra-gen-snapshot-options, matching AOTSnapshotter.build. Extract the
arg construction into a testable tvosGenSnapshotArgs helper and add unit
tests covering the flag matrix. Bump to 1.1.1.

Fixes #10
@MAUstaoglu MAUstaoglu force-pushed the fix/obfuscate-flag-issue-10 branch from e4ef077 to 9c30605 Compare May 28, 2026 12:41
@MAUstaoglu MAUstaoglu requested a review from DenisovAV May 28, 2026 12:45
Comment thread test/general/tvos_aot_snapshot_test.dart Outdated
Comment thread lib/build_targets/application.dart
- Rename the --save-debugging-info file to app.tvos-arm64.symbols (was
  app.ios-arm64.symbols) so it reads naturally for tvOS crash
  symbolication.
- Pair the obfuscation unit test with split-debug-info, the only
  combination that reaches the helper (the CLI rejects --obfuscate
  without --split-debug-info), and document that the helper still emits
  --obfuscate independently, matching AOTSnapshotter.build.
Copilot AI review requested due to automatic review settings May 28, 2026 15:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes tvOS release/profile (AOT) builds silently ignoring --obfuscate and --split-debug-info by ensuring the tvOS-specific gen_snapshot invocation forwards the same relevant flags/options as upstream Flutter’s AOT snapshotting flow.

Changes:

  • Forward --obfuscate, DWARF/split-debug-info flags, and --extra-gen-snapshot-options into the tvOS gen_snapshot AOT assembly step.
  • Extract tvOS gen_snapshot argument construction into a testable helper and add unit tests covering the flag matrix.
  • Bump package version to 1.1.1 and document the fix in the changelog.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
lib/build_targets/application.dart Adds split-debug-info directory creation, routes gen_snapshot invocation through tvosGenSnapshotArgs, and forwards obfuscation/DWARF/extra options.
test/general/tvos_aot_snapshot_test.dart New unit tests validating the generated gen_snapshot argument list across obfuscation/split-debug-info/extra-options combinations.
pubspec.yaml Bumps version from 1.1.0 to 1.1.1.
CHANGELOG.md Adds 1.1.1 entry documenting the fix and forwarded flags.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MAUstaoglu MAUstaoglu requested a review from DenisovAV May 28, 2026 15:44
Copy link
Copy Markdown
Contributor

@DenisovAV DenisovAV left a comment

Choose a reason for hiding this comment

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

Both issues addressed: symbols file renamed to app.tvos-arm64.symbols, and the obfuscate-only test documented with the CLI-layer guard explanation. LGTM.

@DenisovAV DenisovAV merged commit 5810e22 into main May 28, 2026
3 checks passed
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.

obfuscate flag fails silently

3 participants