Skip to content

[native_assets_builder] Build result is half-fed into link result #2149

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

Closed
dcharkes opened this issue Mar 31, 2025 · 0 comments · Fixed by #2171
Closed

[native_assets_builder] Build result is half-fed into link result #2149

dcharkes opened this issue Mar 31, 2025 · 0 comments · Fixed by #2171
Labels
P3 A lower priority bug or feature request package:hooks_runner type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable

Comments

@dcharkes
Copy link
Collaborator

I found this weird code in Flutter tools:

    dependencies.addAll(buildResult.dependencies);
    if (!linkingEnabled) {
      assets.addAll(buildResult.encodedAssets);
    } else {
      // invoke link
      assets.addAll(linkResult.encodedAssets);
      dependencies.addAll(linkResult.dependencies);

It turns out the dependencies for the build and link hook must be combined by the caller but the encodedAssets from the build result are added to the link result, this isn't symmetric.

var hookResult = HookResult(encodedAssets: buildResult.encodedAssets);

This line should be removed to make it symmetric, or the dependencies should be added there to make it symmetric.

This will need a manual roll into Dart & Flutter.

@dcharkes dcharkes added P3 A lower priority bug or feature request package:hooks_runner type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable labels Mar 31, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this issue Apr 10, 2025
Updating the dart-lang/native dependencies to the ones published
yesterday.

Incorporates a fix for:

* dart-lang/native#2149
* Note that a bunch of tests were relying on ignoring build assets. The
tests have been fixed.

And the new `AssetRouting` syntax in the build hook for sending assets
to the link hook:

* dart-lang/native#2164

Does not include support for user-defines in the pubspec yet. Will do
this in a follow up PR.

* dart-lang/native#2165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 A lower priority bug or feature request package:hooks_runner type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant