[record_use] Run build hooks and link hooks in separate targets#184880
Merged
auto-submit[bot] merged 3 commits intoApr 20, 2026
Conversation
b371b21 to
324f275
Compare
9dbd3e2 to
979f805
Compare
979f805 to
29a6180
Compare
a6c698b to
2ede37c
Compare
goderbauer
reviewed
Apr 17, 2026
goderbauer
left a comment
Member
There was a problem hiding this comment.
LGTM, but please let someone from flutter_tools also have a look at this.
2ede37c to
59ec3b6
Compare
bkonyi
previously approved these changes
Apr 17, 2026
bkonyi
left a comment
Contributor
There was a problem hiding this comment.
LGTM overall with some nits.
| } | ||
| final FlutterNativeAssetsBuildRunner buildRunner = | ||
| _buildRunner ?? await createFlutterNativeAssetsBuildRunner(environment); | ||
| final ({SerializedBuildResults results, List<Uri> dependencies}) record = |
Contributor
There was a problem hiding this comment.
Consider destructuring this here instead of creating variables later:
final (SerializedBuildResults :results, List<Uri> :dependencies) = await runFlutterSpecificBuildHooks(...);|
|
||
| final buildStart = DateTime.now(); | ||
|
|
||
| final ({SerializedBuildResults results, List<Uri> dependencies}) buildRecord = |
Contributor
There was a problem hiding this comment.
Same comment here WRT destructuring inline.
| return (results: const <String, Map<String, Object?>>{}, dependencies: const <Uri>[]); | ||
| } | ||
|
|
||
| final ( |
Contributor
There was a problem hiding this comment.
With destructuring, you can omit the LHS name if you're going to assign its value to a variable of the same name:
final (
List<AssetBuildTarget> :targets,
BuildMode :buildMode,
bool :linkingEnabled,
) = await _setupHooks(
environmentDefines: environmentDefines,
buildRunner: buildRunner,
targetPlatform: targetPlatform,
fileSystem: fileSystem,
buildCodeAssets: buildCodeAssets,
buildDataAssets: buildDataAssets,
);| } | ||
| final buildStart = DateTime.now(); | ||
| final ( | ||
| targets: List<AssetBuildTarget> targets, |
| linkResult = await _link(buildRunner, extensions, buildResult, recordedUsesFile); | ||
|
|
||
| if (target is CodeAssetTarget) { | ||
| codeAssets.addAll( |
Contributor
There was a problem hiding this comment.
Nit: consider cascading these calls on codeAssets and dataAssets.
59ec3b6 to
cd9a427
Compare
This was referenced Apr 20, 2026
Closed
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.
Bug:
Splits the build and link hooks into separate
Targets so that the build hooks can run concurrently with gen_kernel, dart2js, and dart2wasm.Caching tests added:
Fixes the test case:
Also refactors the targets to better naming:
DartBuild->BuildHooks(namedart_build->build_hooks)DartLink->LinkHooks(namedart_link->link_hooks)And simplifies the amount of targets:
ForNativeandForWebvariants and made the targets a bit more configurable instead.