Skip to content

Bitcode strip Flutter.framework in assemble build target #77329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2021

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Mar 5, 2021

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
local bitcode_flag=""
if [[ "$ENABLE_BITCODE" == "YES" ]]; then
if [[ "$ENABLE_BITCODE" == "YES" && "$ACTION" == "install" ]]; then
Copy link
Member Author

@jmagman jmagman Mar 5, 2021

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).

@@ -42,7 +42,7 @@ Future<bool> containsBitcode(String pathToBinary) async {
if (line.contains('segname __LLVM') && lines.length - index - 1 > 3) {
final String emptyBitcodeMarker = lines
.skip(index - 1)
.take(3)
.take(4)
Copy link
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
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy