Relax requirements around local engine, build hello_world with bitcode#39357
Relax requirements around local engine, build hello_world with bitcode#39357dnfield merged 3 commits intoflutter:masterfrom
Conversation
| '-miphoneos-version-min=8.0', | ||
| ]; | ||
|
|
||
| final List<String> bitcodeArgs = <String>['-fembed-bitcode']; |
There was a problem hiding this comment.
Re-using this list seems likely to cause errors in the future.
There was a problem hiding this comment.
Changed it to a const string and an expanded single use list below.
|
|
||
| import 'dart:async'; | ||
|
|
||
| import 'package:flutter_tools/src/base/common.dart'; |
There was a problem hiding this comment.
Nit: relative import
| buildSettings = { | ||
| ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | ||
| ENABLE_BITCODE = NO; | ||
| ENABLE_BITCODE = YES; |
There was a problem hiding this comment.
YES should be the default, remove the setting instead of overriding.
| } | ||
|
|
||
| if (bitcode) { | ||
| final String iPhoneSdk = await xcode.iPhoneSdkLocation(); |
There was a problem hiding this comment.
How do you know you need the iPhone SDK?
There was a problem hiding this comment.
A warning is generated otherwise. It may be harmless but I'd like to avoid it.
There was a problem hiding this comment.
Is this codepath is used for iphonesimulator and macosx too?
There was a problem hiding this comment.
Or rather, will it be used for macosx in the future since bitcode is only set from xcode_backend. I believe this would need to be iphonesimulator in the Debug simulator case though?
There was a problem hiding this comment.
This can't be used for simulator because it's AOT and specific to ARM.
It looks like it's already being used for macOS. I'll move this behind some guards similar to what's used for -miphoneos
There was a problem hiding this comment.
We only support x64 desktop, but it is probably better to have semantically named selection
| // gen_snapshot would provide an argument to do this automatically. | ||
| if (platform == TargetPlatform.ios && bitcode) { | ||
| final IOSink sink = fs.file('$assembly.bitcode').openWrite(); | ||
| final IOSink sink = fs.file('$assembly.stripped.S').openWrite(); |
There was a problem hiding this comment.
cc will emit a warning if this file doesn't end with .S.
Codecov Report
@@ Coverage Diff @@
## master #39357 +/- ##
==========================================
- Coverage 56.76% 55.97% -0.79%
==========================================
Files 195 195
Lines 18430 18413 -17
==========================================
- Hits 10461 10306 -155
- Misses 7969 8107 +138
Continue to review full report at Codecov.
|
jonahwilliams
left a comment
There was a problem hiding this comment.
LGTM
Please ignore patch coverage, it is bad. Someday, I'll figure out how to fix it....
…h bitcode (flutter#39357)" (flutter#39431)" This reverts commit 393106f.
Description
Now that we build the engine with bitcode on CI, we should no longer require local engine builds in the tool to enable bitcode.
It is still not turned on by default - a user would have to update their Xcode project to set
ENABLE_BITCODEtoYES, or explicitly pass--bitcodetoflutter build aot.I've also cleaned up some unnecessary changes around the dsym util - apparently it doesn't make sense to have symbols anyway with bitcode, and it was failing locally without some changes for me.
Unfortunately, this no longer validates that bitcode is present in the binary because the method used doesn't work on FAT binaries. We could still validate them by e.g. running
xcrun bitcode_stripon the binary and validating that the output is different from the input, but it seems excessive and would slow down build times.Related Issues
Fixes #15288 (!)
Filed #39356 to track the remaining work once this has had some time to bake.
Tests
I added the following tests:
Updated existing tests for the new changes/removed code.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?