Skip to content

Add data assets#174685

Merged
auto-submit[bot] merged 1 commit intoflutter:masterfrom
mosuem:dataAssets
Sep 2, 2025
Merged

Add data assets#174685
auto-submit[bot] merged 1 commit intoflutter:masterfrom
mosuem:dataAssets

Conversation

@mosuem
Copy link
Contributor

@mosuem mosuem commented Aug 29, 2025

Refiling of #169273 (reverted in #170034), which is a refiling of #164094, which itself is a rebase of #159675.

This PR adds bundling support for the experimental dart data asset feature: Dart packages with hooks can now emit data assets which the flutter tool will bundle.

It relies on flutter's existing asset bundling mechanism (e.g. entries in AssetManifest.json, DevFS syncing in reload/restart, ...).

The support is added under an experimental flag (similar to the existing native assets experimental flag).

Also, kNativeAssets is removed to also bundle data assets on flutter build bundle.

The chrome sandbox is disabled as per #165664.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. a: desktop Running on desktop team-android Owned by Android platform team team-ios Owned by iOS platform team labels Aug 29, 2025
@mosuem mosuem requested a review from bkonyi September 1, 2025 15:25
@mosuem mosuem marked this pull request as ready for review September 1, 2025 15:25
@mosuem mosuem requested review from a team as code owners September 1, 2025 15:25
@mosuem
Copy link
Contributor Author

mosuem commented Sep 1, 2025

@bkonyi The last revert was due to flakes - any how to deflake this? (except for hitting the rerun workflow until I am satisfied it looks good...)

@bkonyi
Copy link
Contributor

bkonyi commented Sep 2, 2025

@bkonyi The last revert was due to flakes - any how to deflake this? (except for hitting the rerun workflow until I am satisfied it looks good...)

Do you have the details around the failures caused by the flakes? I can't seem to find any logs.

If it was failing on multiple platforms, your best bet is to try and reproduce locally. If it doesn't reproduce, you can try running with your machine under load to try and emulate running in a resource constrained environment like the CI bots (I tend to use the stress utility to pin all of my cores).

@mosuem
Copy link
Contributor Author

mosuem commented Sep 2, 2025

Do you have the details around the failures caused by the flakes? I can't seem to find any logs.

Unfortunately the logs seem to have gone by now, at least I also don't have any.

If it was failing on multiple platforms, your best bet is to try and reproduce locally. If it doesn't reproduce, you can try running with your machine under load to try and emulate running in a resource constrained environment like the CI bots (I tend to use the stress utility to pin all of my cores).

Thanks - I'll try that!

@mosuem
Copy link
Contributor Author

mosuem commented Sep 2, 2025

There seems to be an infra failure here? Or did I find a flake? 🙃

cc @matanlurey

@mosuem
Copy link
Contributor Author

mosuem commented Sep 2, 2025

Looking at the test history, it seems that one is flaky without this PR.

@mosuem mosuem added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 2, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Sep 2, 2025
Merged via the queue into flutter:master with commit 661b8ed Sep 2, 2025
144 of 145 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 4, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 5, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 5, 2025
Roll Flutter from 6b18740 to 87d5b75 (88 revisions)

flutter/flutter@6b18740...87d5b75

2025-09-05 [email protected] [ Device Lab ] Add regression testing for flutter/flutter#174952 (flutter/flutter#174956)
2025-09-05 [email protected] Roll Skia from 0ca53adfc6cc to 845ec125e94c (2 revisions) (flutter/flutter#174978)
2025-09-05 [email protected] [a11y-app] Fix NavigationRail leading and trailing labels (flutter/flutter#174861)
2025-09-05 [email protected] Roll Skia from d7e99be07d5d to 0ca53adfc6cc (5 revisions) (flutter/flutter#174972)
2025-09-05 [email protected] Roll Fuchsia Linux SDK from izfNA3o_2zL4Cjqmy... to xG_uERsxHvUwFHpF2... (flutter/flutter#174970)
2025-09-04 [email protected] Fix IconButton.color overrided by IconButtomTheme (flutter/flutter#174515)
2025-09-04 [email protected] [web] Reuse chrome instance to run all flutter tests (flutter/flutter#174957)
2025-09-04 [email protected] fix(Semantics): Ensure semantics properties take priority over button's (flutter/flutter#174473)
2025-09-04 [email protected] Make every LLDB Init error message actionable (flutter/flutter#174726)
2025-09-04 [email protected] Fix table cell semantics rect alignment issues.  (flutter/flutter#174914)
2025-09-04 [email protected] Fix: Use route navigator for CupertinoSheetRoute pop (flutter/flutter#173103)
2025-09-04 [email protected] [ Widget Preview] Add `group` property to `Preview` (flutter/flutter#174849)
2025-09-04 [email protected] Allow OverlayPortal.overlayChildLayoutBuilder to choose root Overlay (flutter/flutter#174239)
2025-09-04 [email protected] Roll Skia from 7c2f502e3304 to d7e99be07d5d (18 revisions) (flutter/flutter#174936)
2025-09-04 [email protected] Remove 'terms of use' wording from web_unicode (flutter/flutter#174939)
2025-09-04 [email protected] [ Tool ] Remove leftover Android x86 deprecation warning constant (flutter/flutter#174941)
2025-09-04 [email protected] Prevent potential crash when accessing window in FlutterSceneDelegate (flutter/flutter#174873)
2025-09-04 [email protected] Roll Packages from 42bb347 to 98580c6 (5 revisions) (flutter/flutter#174943)
2025-09-04 [email protected] [ Device Lab ] Fix wakefulness check to only match log entries with string values (flutter/flutter#174953)
2025-09-04 [email protected] Fix expanded DropdownMenu panel is shorter than text field (flutter/flutter#174443)
2025-09-04 [email protected] Add a `viewController` property to the ios/macOS `FlutterPluginRegistrar` protocol  (flutter/flutter#174168)
2025-09-03 [email protected] Roll Fuchsia Linux SDK from J3T_wZqL_57mRfWky... to izfNA3o_2zL4Cjqmy... (flutter/flutter#174908)
2025-09-03 [email protected] Wires up Android API to set section locale (flutter/flutter#173364)
2025-09-03 [email protected] Delete impeller::SPrintF. (flutter/flutter#174900)
2025-09-03 [email protected] Make sure that a DropdownMenuFormField doesn't crash in 0x0 environment (flutter/flutter#174777)
2025-09-03 [email protected] Remove unnecessary `presubmit_max_attempts` from .ci.yaml (flutter/flutter#174885)
2025-09-03 [email protected] Use local canvaskit in `dart_data_asset_test.dart` (flutter/flutter#174891)
2025-09-03 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Mark Linux web_canvaskit_tests_7_last as bringup (#174878)" (flutter/flutter#174897)
2025-09-03 [email protected] Correct intrinsics calculation for CupertinoTextField with placeholder (flutter/flutter#174889)
2025-09-03 [email protected] Considers large title height in CupertinoNavigationBar's preferred size (flutter/flutter#173722)
2025-09-03 [email protected] [A11y] Add semantics for CupertinoExpansionTile (flutter/flutter#174480)
2025-09-03 [email protected] Fix LinearProgressIndicator track painting. (flutter/flutter#173108)
2025-09-03 [email protected] update triage documentation to include team-android (flutter/flutter#174850)
2025-09-03 [email protected] Update `test_timeout_secs` to match `timeout` for `Linux web_skwasm_tests_*` and `Linux web_canvaskit_tests_*` (flutter/flutter#174881)
2025-09-03 [email protected] Roll Packages from 5d785a0 to 42bb347 (10 revisions) (flutter/flutter#174876)
2025-09-03 [email protected] Fixup formatting of gn files in the old buildroot. (flutter/flutter#174852)
2025-09-03 [email protected] Roll Dart SDK to 3.10.0-162.1.beta (flutter/flutter#174834)
2025-09-03 [email protected] Mark Linux web_canvaskit_tests_7_last as bringup (flutter/flutter#174878)
2025-09-02 [email protected] [Impeller] Fix overdraw in DrawRect geometry (flutter/flutter#174735)
2025-09-02 [email protected] Patch .clang-format files to specify C++20. (flutter/flutter#174848)
2025-09-02 [email protected] Add data assets (flutter/flutter#174685)
2025-09-02 [email protected] refactors `FlutterPlugin.kt` to use one line statement in the `into` bloc (flutter/flutter#174759)
2025-09-02 [email protected] Ensures initial semantics state is sent to engine (flutter/flutter#174845)
2025-09-02 [email protected] [Android] Break up plugin_test integration tests (flutter/flutter#174728)
2025-09-02 [email protected] Fix: Assertion failure in RawScrollbarState with dynamic controller assignment (flutter/flutter#173156)
2025-09-02 [email protected] Roll Skia from 359f3d7cc7ed to 7c2f502e3304 (1 revision) (flutter/flutter#174844)
...
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
Refiling of flutter#169273 (reverted in
flutter#170034), which is a refiling of
flutter#164094, which itself is a rebase of flutter#159675.

This PR adds bundling support for the experimental dart data asset
feature: Dart packages with hooks can now emit data assets which the
flutter tool will bundle.

It relies on flutter's existing asset bundling mechanism (e.g. entries
in AssetManifest.json, DevFS syncing in reload/restart, ...).

The support is added under an experimental flag (similar to the existing
native assets experimental flag).

Also, kNativeAssets is removed to also bundle data assets on flutter
build bundle.

The chrome sandbox is disabled as per flutter#165664.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
Refiling of flutter#169273 (reverted in
flutter#170034), which is a refiling of
flutter#164094, which itself is a rebase of flutter#159675.

This PR adds bundling support for the experimental dart data asset
feature: Dart packages with hooks can now emit data assets which the
flutter tool will bundle.

It relies on flutter's existing asset bundling mechanism (e.g. entries
in AssetManifest.json, DevFS syncing in reload/restart, ...).

The support is added under an experimental flag (similar to the existing
native assets experimental flag).

Also, kNativeAssets is removed to also bundle data assets on flutter
build bundle.

The chrome sandbox is disabled as per flutter#165664.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
danferreira pushed a commit to danferreira/packages that referenced this pull request Oct 22, 2025
Roll Flutter from 6b18740 to 87d5b75 (88 revisions)

flutter/flutter@6b18740...87d5b75

2025-09-05 [email protected] [ Device Lab ] Add regression testing for flutter/flutter#174952 (flutter/flutter#174956)
2025-09-05 [email protected] Roll Skia from 0ca53adfc6cc to 845ec125e94c (2 revisions) (flutter/flutter#174978)
2025-09-05 [email protected] [a11y-app] Fix NavigationRail leading and trailing labels (flutter/flutter#174861)
2025-09-05 [email protected] Roll Skia from d7e99be07d5d to 0ca53adfc6cc (5 revisions) (flutter/flutter#174972)
2025-09-05 [email protected] Roll Fuchsia Linux SDK from izfNA3o_2zL4Cjqmy... to xG_uERsxHvUwFHpF2... (flutter/flutter#174970)
2025-09-04 [email protected] Fix IconButton.color overrided by IconButtomTheme (flutter/flutter#174515)
2025-09-04 [email protected] [web] Reuse chrome instance to run all flutter tests (flutter/flutter#174957)
2025-09-04 [email protected] fix(Semantics): Ensure semantics properties take priority over button's (flutter/flutter#174473)
2025-09-04 [email protected] Make every LLDB Init error message actionable (flutter/flutter#174726)
2025-09-04 [email protected] Fix table cell semantics rect alignment issues.  (flutter/flutter#174914)
2025-09-04 [email protected] Fix: Use route navigator for CupertinoSheetRoute pop (flutter/flutter#173103)
2025-09-04 [email protected] [ Widget Preview] Add `group` property to `Preview` (flutter/flutter#174849)
2025-09-04 [email protected] Allow OverlayPortal.overlayChildLayoutBuilder to choose root Overlay (flutter/flutter#174239)
2025-09-04 [email protected] Roll Skia from 7c2f502e3304 to d7e99be07d5d (18 revisions) (flutter/flutter#174936)
2025-09-04 [email protected] Remove 'terms of use' wording from web_unicode (flutter/flutter#174939)
2025-09-04 [email protected] [ Tool ] Remove leftover Android x86 deprecation warning constant (flutter/flutter#174941)
2025-09-04 [email protected] Prevent potential crash when accessing window in FlutterSceneDelegate (flutter/flutter#174873)
2025-09-04 [email protected] Roll Packages from 42bb347 to 98580c6 (5 revisions) (flutter/flutter#174943)
2025-09-04 [email protected] [ Device Lab ] Fix wakefulness check to only match log entries with string values (flutter/flutter#174953)
2025-09-04 [email protected] Fix expanded DropdownMenu panel is shorter than text field (flutter/flutter#174443)
2025-09-04 [email protected] Add a `viewController` property to the ios/macOS `FlutterPluginRegistrar` protocol  (flutter/flutter#174168)
2025-09-03 [email protected] Roll Fuchsia Linux SDK from J3T_wZqL_57mRfWky... to izfNA3o_2zL4Cjqmy... (flutter/flutter#174908)
2025-09-03 [email protected] Wires up Android API to set section locale (flutter/flutter#173364)
2025-09-03 [email protected] Delete impeller::SPrintF. (flutter/flutter#174900)
2025-09-03 [email protected] Make sure that a DropdownMenuFormField doesn't crash in 0x0 environment (flutter/flutter#174777)
2025-09-03 [email protected] Remove unnecessary `presubmit_max_attempts` from .ci.yaml (flutter/flutter#174885)
2025-09-03 [email protected] Use local canvaskit in `dart_data_asset_test.dart` (flutter/flutter#174891)
2025-09-03 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Mark Linux web_canvaskit_tests_7_last as bringup (#174878)" (flutter/flutter#174897)
2025-09-03 [email protected] Correct intrinsics calculation for CupertinoTextField with placeholder (flutter/flutter#174889)
2025-09-03 [email protected] Considers large title height in CupertinoNavigationBar's preferred size (flutter/flutter#173722)
2025-09-03 [email protected] [A11y] Add semantics for CupertinoExpansionTile (flutter/flutter#174480)
2025-09-03 [email protected] Fix LinearProgressIndicator track painting. (flutter/flutter#173108)
2025-09-03 [email protected] update triage documentation to include team-android (flutter/flutter#174850)
2025-09-03 [email protected] Update `test_timeout_secs` to match `timeout` for `Linux web_skwasm_tests_*` and `Linux web_canvaskit_tests_*` (flutter/flutter#174881)
2025-09-03 [email protected] Roll Packages from 5d785a0 to 42bb347 (10 revisions) (flutter/flutter#174876)
2025-09-03 [email protected] Fixup formatting of gn files in the old buildroot. (flutter/flutter#174852)
2025-09-03 [email protected] Roll Dart SDK to 3.10.0-162.1.beta (flutter/flutter#174834)
2025-09-03 [email protected] Mark Linux web_canvaskit_tests_7_last as bringup (flutter/flutter#174878)
2025-09-02 [email protected] [Impeller] Fix overdraw in DrawRect geometry (flutter/flutter#174735)
2025-09-02 [email protected] Patch .clang-format files to specify C++20. (flutter/flutter#174848)
2025-09-02 [email protected] Add data assets (flutter/flutter#174685)
2025-09-02 [email protected] refactors `FlutterPlugin.kt` to use one line statement in the `into` bloc (flutter/flutter#174759)
2025-09-02 [email protected] Ensures initial semantics state is sent to engine (flutter/flutter#174845)
2025-09-02 [email protected] [Android] Break up plugin_test integration tests (flutter/flutter#174728)
2025-09-02 [email protected] Fix: Assertion failure in RawScrollbarState with dynamic controller assignment (flutter/flutter#173156)
2025-09-02 [email protected] Roll Skia from 359f3d7cc7ed to 7c2f502e3304 (1 revision) (flutter/flutter#174844)
...
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
Refiling of flutter#169273 (reverted in
flutter#170034), which is a refiling of
flutter#164094, which itself is a rebase of flutter#159675.

This PR adds bundling support for the experimental dart data asset
feature: Dart packages with hooks can now emit data assets which the
flutter tool will bundle.

It relies on flutter's existing asset bundling mechanism (e.g. entries
in AssetManifest.json, DevFS syncing in reload/restart, ...).

The support is added under an experimental flag (similar to the existing
native assets experimental flag).

Also, kNativeAssets is removed to also bundle data assets on flutter
build bundle.

The chrome sandbox is disabled as per flutter#165664.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
JSUYA added a commit to JSUYA/flutter-tizen that referenced this pull request Dec 10, 2025
JSUYA added a commit to JSUYA/flutter-tizen that referenced this pull request Dec 15, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jan 29, 2026
Since #174685, the code assets
are wrongly invoked on in the `flutter run` process (in addition to
rightly in the `flutter assemble` process). This should not be the case:
We don't know the target architectures we want to build for, neither do
we know which native compiler is set by the native build system that is
invoking us
(#181004 (review)).

This PR changes the way the hooks are invoked:

* From `flutter run` only run for data assets. (Unblocks
#181004)
* All other remaining calls, run for both. There might be locations
where data assets could be disabled, but they are needed from the
`DartBuild` target at least in some cases.

The architecture becomes as follows:

* `FlutterNativeAssetsBuildRunner` this is basically the wrapper around
the `NativeAssetsBuildRunner` and there should be only one in a
`flutter_tools` instance, unchanged.
* `FlutterHookRunner` seems to be an interface to be able to supply
fakes, unchanged.
* `runFlutterSpecificHooks` get bool arguments whether they should build
code assets and data assets.
* The callers of these APIs know what asset types are needed in that
context. The invocations added in
#174685 should be data assets
only.
* Simplification: `FlutterHookRunnerNative.runHooks` does no longer use
`globals.buildSystem.build`. Instead, it directly calls
`runFlutterSpecificHooks`.
* This completely avoids writing to the flutter build directory, which
was the cause of #178529.
* The `ProtocolExtension`s (which determine which asset types are built)
are taken from `AssetBuildTarget`s, and take into account what asset
types to build, unchanged.

Tests:

* Code assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart
* Data assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
* This PR completely deletes
packages/flutter_tools/test/general.shard/build_system/targets/hook_runner_native_test.dart.
It was a unit test that testsed the specific workaround, not the effect
of the workaround.
* I've manually tested the steps in
#178529 (comment),
the issue does not come back.
  
> the underlying issue did involve conflict between state written by the
original run of the build system versus state written by the secondary
run executed for the data assets. If the secondary run can be avoided,
then that seems cleaner.

Yep, removed.
JSUYA added a commit to JSUYA/flutter-tizen that referenced this pull request Feb 5, 2026
After copying flutter_assets into the TPK staging directory, verify that flutter_assets/data is present when produced by the build, to catch packaging regressions as upstream data assets evolve.

Refs: flutter/flutter#174685
flutter/flutter#174685
JSUYA added a commit to JSUYA/flutter-tizen that referenced this pull request Feb 5, 2026
After copying flutter_assets into the TPK/module staging directory, verify that flutter_assets/data is present when produced by the build, to catch packaging regressions as upstream data assets evolve.

Refs: flutter/flutter#174685
flutter/flutter#174685
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Feb 6, 2026
…er#181542)

Since flutter#174685, the code assets
are wrongly invoked on in the `flutter run` process (in addition to
rightly in the `flutter assemble` process). This should not be the case:
We don't know the target architectures we want to build for, neither do
we know which native compiler is set by the native build system that is
invoking us
(flutter#181004 (review)).

This PR changes the way the hooks are invoked:

* From `flutter run` only run for data assets. (Unblocks
flutter#181004)
* All other remaining calls, run for both. There might be locations
where data assets could be disabled, but they are needed from the
`DartBuild` target at least in some cases.

The architecture becomes as follows:

* `FlutterNativeAssetsBuildRunner` this is basically the wrapper around
the `NativeAssetsBuildRunner` and there should be only one in a
`flutter_tools` instance, unchanged.
* `FlutterHookRunner` seems to be an interface to be able to supply
fakes, unchanged.
* `runFlutterSpecificHooks` get bool arguments whether they should build
code assets and data assets.
* The callers of these APIs know what asset types are needed in that
context. The invocations added in
flutter#174685 should be data assets
only.
* Simplification: `FlutterHookRunnerNative.runHooks` does no longer use
`globals.buildSystem.build`. Instead, it directly calls
`runFlutterSpecificHooks`.
* This completely avoids writing to the flutter build directory, which
was the cause of flutter#178529.
* The `ProtocolExtension`s (which determine which asset types are built)
are taken from `AssetBuildTarget`s, and take into account what asset
types to build, unchanged.

Tests:

* Code assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart
* Data assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
* This PR completely deletes
packages/flutter_tools/test/general.shard/build_system/targets/hook_runner_native_test.dart.
It was a unit test that testsed the specific workaround, not the effect
of the workaround.
* I've manually tested the steps in
flutter#178529 (comment),
the issue does not come back.
  
> the underlying issue did involve conflict between state written by the
original run of the build system versus state written by the secondary
run executed for the data assets. If the secondary run can be avoided,
then that seems cleaner.

Yep, removed.
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
…er#181542)

Since flutter#174685, the code assets
are wrongly invoked on in the `flutter run` process (in addition to
rightly in the `flutter assemble` process). This should not be the case:
We don't know the target architectures we want to build for, neither do
we know which native compiler is set by the native build system that is
invoking us
(flutter#181004 (review)).

This PR changes the way the hooks are invoked:

* From `flutter run` only run for data assets. (Unblocks
flutter#181004)
* All other remaining calls, run for both. There might be locations
where data assets could be disabled, but they are needed from the
`DartBuild` target at least in some cases.

The architecture becomes as follows:

* `FlutterNativeAssetsBuildRunner` this is basically the wrapper around
the `NativeAssetsBuildRunner` and there should be only one in a
`flutter_tools` instance, unchanged.
* `FlutterHookRunner` seems to be an interface to be able to supply
fakes, unchanged.
* `runFlutterSpecificHooks` get bool arguments whether they should build
code assets and data assets.
* The callers of these APIs know what asset types are needed in that
context. The invocations added in
flutter#174685 should be data assets
only.
* Simplification: `FlutterHookRunnerNative.runHooks` does no longer use
`globals.buildSystem.build`. Instead, it directly calls
`runFlutterSpecificHooks`.
* This completely avoids writing to the flutter build directory, which
was the cause of flutter#178529.
* The `ProtocolExtension`s (which determine which asset types are built)
are taken from `AssetBuildTarget`s, and take into account what asset
types to build, unchanged.

Tests:

* Code assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart
* Data assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
* This PR completely deletes
packages/flutter_tools/test/general.shard/build_system/targets/hook_runner_native_test.dart.
It was a unit test that testsed the specific workaround, not the effect
of the workaround.
* I've manually tested the steps in
flutter#178529 (comment),
the issue does not come back.
  
> the underlying issue did involve conflict between state written by the
original run of the build system versus state written by the secondary
run executed for the data assets. If the secondary run can be avoided,
then that seems cleaner.

Yep, removed.
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
…er#181542)

Since flutter#174685, the code assets
are wrongly invoked on in the `flutter run` process (in addition to
rightly in the `flutter assemble` process). This should not be the case:
We don't know the target architectures we want to build for, neither do
we know which native compiler is set by the native build system that is
invoking us
(flutter#181004 (review)).

This PR changes the way the hooks are invoked:

* From `flutter run` only run for data assets. (Unblocks
flutter#181004)
* All other remaining calls, run for both. There might be locations
where data assets could be disabled, but they are needed from the
`DartBuild` target at least in some cases.

The architecture becomes as follows:

* `FlutterNativeAssetsBuildRunner` this is basically the wrapper around
the `NativeAssetsBuildRunner` and there should be only one in a
`flutter_tools` instance, unchanged.
* `FlutterHookRunner` seems to be an interface to be able to supply
fakes, unchanged.
* `runFlutterSpecificHooks` get bool arguments whether they should build
code assets and data assets.
* The callers of these APIs know what asset types are needed in that
context. The invocations added in
flutter#174685 should be data assets
only.
* Simplification: `FlutterHookRunnerNative.runHooks` does no longer use
`globals.buildSystem.build`. Instead, it directly calls
`runFlutterSpecificHooks`.
* This completely avoids writing to the flutter build directory, which
was the cause of flutter#178529.
* The `ProtocolExtension`s (which determine which asset types are built)
are taken from `AssetBuildTarget`s, and take into account what asset
types to build, unchanged.

Tests:

* Code assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/native_assets_test.dart
* Data assets covered by existing integration tests such as
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
* This PR completely deletes
packages/flutter_tools/test/general.shard/build_system/targets/hook_runner_native_test.dart.
It was a unit test that testsed the specific workaround, not the effect
of the workaround.
* I've manually tested the steps in
flutter#178529 (comment),
the issue does not come back.
  
> the underlying issue did involve conflict between state written by the
original run of the build system versus state written by the secondary
run executed for the data assets. If the secondary run can be avoided,
then that seems cleaner.

Yep, removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop team-android Owned by Android platform team team-ios Owned by iOS platform team 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