Skip to content

Allow iOS Flutter.framework thinning to be skipped - #76886

Closed
jmagman wants to merge 2 commits into
flutter:masterfrom
jmagman:skip-thinning
Closed

jmagman wants to merge 2 commits into
flutter:masterfrom
jmagman:skip-thinning

Conversation

@jmagman

@jmagman jmagman commented Feb 26, 2021

Copy link
Copy Markdown
Member

Implement ThinIosApplicationFrameworks.canSkip(). If Flutter.framework contains exactly the requested architectures (the x86_64 simulator framework or xcarchive, for example), then don't lipo -extract anything.

Follow up to #76665.

@jmagman jmagman added c: contributor-productivity Team-specific productivity, code health, technical debt. platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management labels Feb 26, 2021
@jmagman jmagman self-assigned this Feb 26, 2021
@flutter-dashboard flutter-dashboard Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Feb 26, 2021
@google-cla google-cla Bot added the cla: yes label Feb 26, 2021
}
final Map<Environment, Set<String>> _existingArchsByEnvironment = <Environment, Set<String>>{};

String _lipoOutput(Environment environment) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is the cache/lack of const necessary?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So lipo -info isn't called twice, once to see if it can be skipped, then a second time when build is called.

However that call is extremely fast (on my machine 0.00s user 0.00s system 73% cpu 0.012 total) so I can be convinced the extra complexity/lack of const isn't worth it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe it is worth it, but then you'd need to be sure that any targets that declare this as a dependency use the same instance of this object - otherwise you will repeat the work anyway

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

generally I would say ensure correctness first and then hit performance later. Since the rest of the target instances are used in a const manner I would say its safer to keep this class more like them

@jonahwilliams jonahwilliams left a comment

Copy link
Copy Markdown
Contributor

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 t: xcode "xcodebuild" on iOS and general Xcode project management 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