8000 Build/copy macOS frameworks to built products instead of ephemeral directory by jmagman · Pull Request #72378 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Build/copy macOS frameworks to built products instead of ephemeral directory #72378

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

Merged
merged 2 commits into from
Dec 17, 2020

Conversation

jmagman
Copy link
Member
@jmagman jmagman commented Dec 15, 2020

Description

macOS version of #69699 and part of #70224.

  • Instead of building App.framework and copying FlutterMacOS.framework to Flutter/ephemeral, instead target BUILT_PRODUCTS_DIR (for example build/macos/Build/Products/Debug/).
  • Remove FRAMEWORK_SEARCH_PATHS build setting from template and all example projects to prefer the built products directory, which we always get for free. I didn't write a migrator since leaving this around in existing apps is harmless--the inherited part means it will find our copied framework first.

This:

  1. Prevents issues like flutter build ios --release may use a debug Flutter.framework by mistake #37850 where flutter build macos --debug is run right before running in Release/archiving in Xcode and some pieces build before the xcconfig can be updated.
  2. Makes caching indirectly aware of $CONFIGURATIONs so we don't have to keep track of whether to rebuild or recopy frameworks when switching from Debug to Release. Either the frameworks are in build/macos/Build/Products/{Debug,Release}/ or they aren't.

Related Issues

#72372
Blocked by #72020, which changes plugins from linking on Flutter/ephemeral/FlutterMacOS.framework to instead linking directly on the framework in the engine artifacts.

Tests

Updated macos_test
Already validated by macos_content_validation_test

@jmagman jmagman added the platform-mac Building on or for macOS specifically label Dec 15, 2020
@jmagman jmagman self-assigned this Dec 15, 2020
@flutter-dashboard flutter-dashboard bot added team Infra upgrades, team productivity, code health, technical debt. See also team: labels. tool Affects the "flutter" command-line tool. See also t: labels. labels Dec 15, 2020
@google-cla google-cla bot added the cla: yes label Dec 15, 2020
@@ -38,53 +38,36 @@ abstract class UnpackMacOS extends Target {
];

@override
List<Source> get outputs => const <Source>[];
List<Source> get outputs => const <Source>[
Source.pattern('{OUTPUT_DIR}/FlutterMacOS.framework/FlutterMacOS'),
Copy link
Member Author

Choose a reason for hiding this comment

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

Either it's already been copied to build/macos/Build/Products/Debug or it hasn't, so we don't need unpack_macos.d anymore. The subclasses include Source.artifact(Artifact.flutterMacOSFramework, mode: x) which will cause re-copies on flutter upgrades.

Copy link
Contributor
@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM!

'- .DS_Store/',
basePath,
environment.outputDir.path,
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please update the comment on this class, which currently says we're using cp -R.

@jmagman
Copy link
Member Author
jmagman commented Dec 17, 2020

Google testing failed, but I don't see any test results for that PR in FRoB, failing or otherwise. Since it 8000 passed before my comment-only change I'll call it good.

@jmagman jmagman merged commit d6857bc into flutter:master Dec 17, 2020
@jmagman jmagman deleted the macos-build-dir branch December 17, 2020 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-mac Building on or for macOS specifically team Infra upgrades, team productivity, code health, technical debt. See also team: labels. 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
0