Skip to content

Bitcode strip Flutter.framework in assemble build target - #77329

Merged
jmagman merged 1 commit into
flutter:masterfrom
jmagman:bitcode-strp
Mar 5, 2021
Merged

jmagman merged 1 commit into
flutter:masterfrom
jmagman:bitcode-strp

Conversation

@jmagman

@jmagman jmagman commented Mar 5, 2021 •

Copy link
Copy Markdown
Member

The xcode_backend script stripped bitcode from the Flutter.framework when bitcode is off or when not archiving to reduce install app size.

  1. Move bitcode stripping into the copy Flutter.framework assemble target.
  2. Don't generate bitcode for the App.framework unless archiving.
  3. Switch the bitcode_strip flag from -r (which removes the bitcode section entirely) to -m (which leaves the bitcode marker). This seems safer to me in case bitcode gets switched off or on, and matches the Xcode default behavior.

Added assemble target unit tests, but this is also already covered by existing tests like

if (mode == 'Release' && !await containsBitcode(frameworkPath)) {
throw TaskResult.failure('$frameworkPath does not contain bitcode');
}

expect(containsBitcode(outputFlutterFrameworkBinary.path, processManager), isFalse);

More of #77007

@jmagman jmagman added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Mar 5, 2021
@jmagman jmagman self-assigned this Mar 5, 2021
@google-cla google-cla Bot added the cla: yes label Mar 5, 2021

@jmagman jmagman Mar 5, 2021 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

"$ACTION" == "install" is only true when archiving (for distribution or App Store submission).

final String emptyBitcodeMarker = lines
.skip(index - 1)
.take(3)
.take(4)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Bug in the bitcode detection.

@flutter-dashboard flutter-dashboard Bot added the c: contributor-productivity Team-specific productivity, code health, technical debt. label Mar 5, 2021
@jmagman
jmagman requested a review from jonahwilliams March 5, 2021 06:54

@jonahwilliams jonahwilliams 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants