Skip to content

Conversation

@gmackall
Copy link
Member

@gmackall gmackall commented Jan 13, 2025

Remake of flutter/engine#52852.

Makes it so that stripped defaults to false for android in gn arguments, i.e. we don't strip the Android engine builds. AGP does this by default when the NDK is installed (and we download it automatically now after #159756).

In testing, the step that AGP does to strip symbols adds ~1-2 seconds to the build.

Adds a tool verification for release app bundle builds that checks to make sure we have stripped the debug symbols and placed them in the BUNDLE-METADATA directory. The check is done by invoking apkanalyzer, which takes ~0.5 seconds, which is why the check is only enabled for release builds.

BEFORE LANDING: I need to follow up on flutter/engine#50443 (comment), to ensure we start stripping symbols internally as well.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added the engine flutter/engine related. See also e: labels. label Jan 13, 2025
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 29, 2025
@gmackall gmackall marked this pull request as ready for review January 30, 2025 01:22
@gmackall gmackall requested review from a team and bkonyi January 30, 2025 15:34
@gmackall gmackall changed the title [remake] Remove default for stripped option, don't strip by default on android Remove default for stripped option in engine/src/flutter/tools/gn, don't strip by default on android Jan 30, 2025
processManager.addCommand(
const FakeCommand(
command: <String>[
'gradlew',
Copy link
Contributor

Choose a reason for hiding this comment

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

There are a lot of flags here that probably came from the flutter tool. Later when the tool is changed and we need to update this test it will be harder to figure out why.

link where you came up with these flags and their values.

Copy link
Member Author

Choose a reason for hiding this comment

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

Pulled out to a constant which will make updating easy. For where they came from, I just copied them from the existing tests. I can go find where all the flags come from if you think it is worthwhile

Copy link
Contributor

@bkonyi bkonyi left a comment

Choose a reason for hiding this comment

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

I think we can share a lot of the logic between tests, so it's probably worth taking another look and refactoring them.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 10, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
martinetd added a commit to martinetd/flutter that referenced this pull request Feb 6, 2026
flutter#161546 changed the stripped option with the intent to be true for
android, and false for all other targets, but the check never worked as
intended because parser store_true action default value is False so the
final else was never used.

This fixes the build size increase that was noticed on flutter 3.32 for
linux targets
martinetd added a commit to martinetd/flutter that referenced this pull request Feb 6, 2026
flutter#161546 changed the stripped option with the intent to be true for
android, and false for all other targets, but the check never worked as
intended because parser store_true action default value is False so the
final else was never used.

This fixes the build size increase that was noticed on flutter 3.32 for
linux targets
martinetd added a commit to martinetd/flutter-embedded-linux that referenced this pull request Feb 6, 2026
release build got much bigger since flutter 3.32 (for debug it went from
83MB to 385MB)
This is apparently just because the lib is no longer stripped since [1]

This looks like a bug since we don't target android (tentative fix in
[2]), but until that lands just set --stripped manually.
Even if there is no C symbol dart stacktraces are available so most
people don't need these.

Link: flutter/flutter#161546 [1]
Link: flutter/flutter#181984 [2]
martinetd added a commit to martinetd/flutter that referenced this pull request Feb 6, 2026
flutter#161546 changed the stripped option with the intent to be true for
android, and false for all other targets, but the check never worked as
intended because parser store_true action default value is False so the
final else was never used.

This fixes the build size increase that was noticed on flutter 3.32 for
linux targets
github-merge-queue bot pushed a commit that referenced this pull request Feb 10, 2026
#161546 changed the stripped option with the intent to be true for
android, and false for all other targets, but the check never worked as
intended because parser store_true action default value is False so the
final else was never used.

This fixes the build size increase that was noticed on flutter 3.32 for
linux targets

Fixes #181983

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [ ] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants