Skip to content

Conversation

@jmagman
Copy link
Member

@jmagman jmagman commented Oct 3, 2022

Starting with Xcode 14, bitcode is no longer required for watchOS and tvOS applications, and the App Store no longer accepts bitcode submissions from Xcode 14.

https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes

  • Stop embedding bitcode and markers in App.framework.
  • Always strip bitcode from Flutter.framework in release (until Remove bitcode support from engine #107884 is complete).
  • Disable bitcode for Flutter plugins in Podfile so they do not link on stripped Flutter.framework
  • Stop embedding bcsymbolmap bitcode symbol maps as part of flutter build ios-framework

Fixes #107883

#112828 project migration should be merged first.

Pre-launch Checklist

  • 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.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • 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.
  • All existing and new tests are passing.

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

@jmagman jmagman self-assigned this Oct 3, 2022
@flutter-dashboard flutter-dashboard bot added platform-ios iOS applications specifically c: contributor-productivity Team-specific productivity, code health, technical debt. tool Affects the "flutter" command-line tool. See also t: labels. labels Oct 3, 2022
Copy link
Member Author

Choose a reason for hiding this comment

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

fails when bitcode strip fails test will only pass during ReleaseUnpackIOS since stripping will now only happen on release, not dependent on kBitcodeFlag.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was moved from the now-deleted darwin_common.dart, bitcode isn't a thing on macOS, so it's not shared. I don't know why I ever added the check to the macOS validation test.

@jmagman jmagman force-pushed the remove-bitcode-tool branch from 13bdae9 to ddad8c8 Compare October 3, 2022 23:09
@jmagman jmagman force-pushed the remove-bitcode-tool branch from ddad8c8 to 04a8623 Compare October 3, 2022 23:25
@jmagman jmagman marked this pull request as ready for review October 3, 2022 23:43
}
_thinFramework(environment, frameworkBinaryPath, archs);
_bitcodeStripFramework(environment, frameworkBinaryPath);
if (buildMode == BuildMode.release) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

(Currently until we remove it) the release version of Flutter.framework has a giant bitcode blob, and now we always want to strip it out.

I deleted the logic passing the Xcode build setting ENABLE_BITCODE down into assemble as kBitcodeFlag. It would only be true if ENABLE_BITCODE was set, AND it was an "install" command, meaning it was archiving.

String bitcodeFlag = '';
if (environment['ENABLE_BITCODE'] == 'YES' && environment['ACTION'] == 'install') {
bitcodeFlag = 'true';
}

This was the check in the target that was deleted:

void _bitcodeStripFramework(Environment environment, String frameworkBinaryPath) {
if (environment.defines[kBitcodeFlag] == 'true') {
return;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh, makes sense. Thanks!

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

'bitcode_strip',
frameworkBinaryPath,
'-m', // leave the bitcode marker.
'-r', // Delete the bitcode segment.
Copy link
Member Author

Choose a reason for hiding this comment

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

Just made this change, totally delete it instead of leaving the marker:

OPTIONS
       -r     Remove the __LLVM bitcode segment entirely.

       -m     Remove the bitcode from the __LLVM segment, leaving behind a
              marker.

@jmagman jmagman added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 4, 2022
@auto-submit auto-submit bot merged commit 35afe1b into flutter:master Oct 4, 2022
@jmagman jmagman deleted the remove-bitcode-tool branch October 4, 2022 02:10
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 4, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App 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.

Remove bitcode support from the flutter tool, -fembed-bitcode and -fembed-bitcode-marker and bcsymbolmap logic

2 participants