Skip linking against Flutter for CocoaPods transitive dependencies#78592
Merged
jmagman merged 1 commit intoMar 19, 2021
Merged
Conversation
stuartmorgan-g
approved these changes
Mar 19, 2021
stuartmorgan-g
left a comment
Contributor
There was a problem hiding this comment.
LGTM. (I'm assuming "links on" means the same thing as "links against"? I've not encountered that terminology.)
Member
Author
Yeah it was late. 😄 |
Contributor
In that case: link on, and be excellent to your libraries 😁 |
This was referenced Mar 24, 2021
christopherfujino
pushed a commit
to chris-forks/flutter
that referenced
this pull request
Mar 31, 2021
christopherfujino
added a commit
that referenced
this pull request
Apr 1, 2021
* Skip linking on Flutter for CocoaPods transitive dependencies (#78592) * Apply Engine cherrypicks for release 2.0.4 Co-authored-by: Jenn Magder <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Flutter plugins need to link against
Flutter.frameworkorFlutterMacOS.framework. That work is done in the app's Podfile like:flutter_additional_ios_build_settingsandflutter_additional_macos_build_settingssets up the search paths to point to thebin/cacheversion ofFlutter.frameworkorFlutterMacOS.framework, and for iOS additionally links againstFlutter.flutter/packages/flutter_tools/bin/podhelper.rb
Line 63 in efbde44
ALL pods, even non-Flutter plugins transitive dependencies, were therefore linking against Flutter.
For example, Flutter plugin
firebase_admobneeds to link against Flutter. That plugin has a transitive dependency onGoogle-Mobile-Ads-SDKwhich being incorrectly also linked toFlutter.framework.The problem
#72151 causes an issue where, if a transitive dependency contained bitcode, it fails when linking against the debug version of Flutter (which isn't necessary since the transitive dependencies don't need to know anything about Flutter) because debug Flutter only contains a bitcode marker, not full bitcode.
The fix
Change the
podhelperlogic to only set up all the Flutter build settings ONLY for Flutter plugins and not their transitive dependencies.Add a a plugin with a transitive dependency to
build_ios_framework_module_testand test that the dependency doesn't link against Flutter.https://ci.chromium.org/p/flutter/builders/try/Mac%20build_ios_framework_module_test/4725
On master this test fails:
Fixes #78589