-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Flutter assemble for macos take 2! #36987
Flutter assemble for macos take 2! #36987
Conversation
Codecov Report
@@ Coverage Diff @@
## master #36987 +/- ##
==========================================
+ Coverage 54.19% 55.6% +1.41%
==========================================
Files 193 193
Lines 17892 17982 +90
==========================================
+ Hits 9696 9999 +303
+ Misses 8196 7983 -213
Continue to review full report at Codecov.
|
${local_engine_flag} | ||
${local_engine_flag} \ | ||
assemble \ | ||
-dTargetFile="${target_path}" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBD: flavor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this a TODO that points to the flavors issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// Remove "inputs" that were outputs of previous builds. | ||
buildInstance.inputFiles.removeWhere((String path, File file) { | ||
// Leaking implementation detail: remove pubpsec, flutter-plugins, generated. | ||
return buildInstance.outputFiles.containsKey(path) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do these make it into the input list? Is there a sanity check that can be done here instead ahead-of-time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this check into the input list construction
@@ -472,10 +480,28 @@ class BuildSystem { | |||
// Always persist the file cache to disk. | |||
fileCache.persist(); | |||
} | |||
// Remove "inputs" that were outputs of previous builds. | |||
buildInstance.inputFiles.removeWhere((String path, File file) { | |||
// Leaking implementation detail: remove pubpsec, flutter-plugins, generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should explain why these are being blacklisted and/or the criteria for adding items to this list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with a longer TODO that explains why this is here for now, and what needs to be done to remove it.
@@ -105,6 +105,9 @@ class SourceVisitor { | |||
} | |||
} | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flip the sense to if (!hasWildcard) and return early under that if to unindent the big chunk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
@override | ||
List<Source> get outputs => const <Source>[ | ||
// No outputs because Cocoapods is fully responsible for tracking. plus there |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this produce something like a .stamp file that dependent rules can use to track?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd need to right it such that the file contents changed as well. Just a stamp wont work since we're using file hashes, at that point it is probably close to the same as .flutter-plugins.
I've updated this with an explicit todo to add a planning phase so I can conditionally insert the pod rule. Then I can use the regular outputs.
@zanderso PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm w/ nits
${local_engine_flag} | ||
${local_engine_flag} \ | ||
assemble \ | ||
-dTargetFile="${target_path}" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make this a TODO that points to the flavors issue.
@@ -39,7 +39,7 @@ class SourceVisitor { | |||
/// Visit a [Source] which contains a file uri. | |||
/// | |||
/// The uri may that may include constants defined in an [Environment]. | |||
void visitPattern(String pattern) { | |||
void visitPattern(String pattern, bool optional) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Describe 'optional' parameter in the doc comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
} | ||
|
||
// TODO(jonahwilliams): real AOT implementation. | ||
class ReleaseMacOSApplication extends DebugMacOSApplication { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these have a build method that throws an UnimplementedError?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The release mode is a bit of a lie today, but it does exist
@@ -106,10 +112,34 @@ class AssembleCommand extends FlutterCommand { | |||
printError('Target ${data.key} failed: ${data.value.exception}'); | |||
printError('${data.value.exception}'); | |||
} | |||
throwToolExit('build failed'); | |||
throwToolExit('build failed.'); | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if (!flutterBuildDir.existsSync()) { | ||
flutterBuildDir.createSync(recursive: true); | ||
} | ||
// Create the environment used to process the build. This need sto mtach what |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this need sto -> this needs to
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// Set debug or release mode. | ||
String config = 'Debug'; | ||
if (buildInfo.isRelease) { | ||
if (buildInfo.isRelease == true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this because isRelease could be null? In that case, how about buildInfo.isRelease ?? false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -81,26 +81,28 @@ class MacOSDevice extends Device { | |||
bool ipv6 = false, | |||
}) async { | |||
// Stop any running applications with the same executable. | |||
PrebuiltMacOSApp prebuiltMacOSApp; | |||
if (!prebuiltApplication) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think positive (unless there's a good reason not to):
if (prebuiltApplication) {
...
} else {
...
}
Also, should the Cache lock be released early in both cases, or just when prebuiltAppllication is false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
track_widget_creation_flag="" | ||
if [[ -n "$TRACK_WIDGET_CREATION" ]]; then | ||
track_widget_creation_flag="--track-widget-creation" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this regressed the bug where hot reload crashes in IDEs; I'm not sure why it was taken out.
I'll send a follow-up PR shortly.
Description
Updates the BuildResult to track input and output files. Due to some issues with other parts of the tool re-writing these files constantly, some have been factored out of the list.
Adds an "optional" source and a pod rule to use it. Until I add a configuration/planning phase I need to add the pod step to every build, but only run it when a podfile exists.
Implementation of flutter assemble for the macOS build. This updates the entrypoint script to move all artifact copying/generation into build rules. This also generates an input/output xcfilelist that can be used by xcode to skip the entire script phase.
This requires the project changes in google/flutter-desktop-embedding#459
#32921