-
Notifications
You must be signed in to change notification settings - Fork 28.9k
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
Conversation
local bitcode_flag="" | ||
if [[ "$ENABLE_BITCODE" == "YES" ]]; then | ||
if [[ "$ENABLE_BITCODE" == "YES" && "$ACTION" == "install" ]]; then |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The
xcode_backend
script stripped bitcode from theFlutter.framework
when bitcode is off or when not archiving to reduce install app size.App.framework
unless archiving.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
flutter/dev/devicelab/bin/tasks/build_ios_framework_module_test.dart
Lines 433 to 435 in 3082a28
flutter/packages/flutter_tools/test/integration.shard/ios_content_validation_test.dart
Line 128 in 42c9e27
More of #77007