Repository navigation
[flutter_tools] Rebuild asset bundle when generated manifest content changes - #191638
Merged
Merged
Conversation
…changes In `flutter test`, the tool checks if the unit test asset bundle needs to be rebuilt by comparing the last modified timestamp of `AssetManifest.bin` against `pubspec.yaml` and physical asset files. However, when Flutter changes the schema or generated content of `AssetManifest.bin` or other synthetic asset metadata (such as `FontManifest.json` or `NOTICES`) without changes to `pubspec.yaml` or physical asset timestamps, tests continue using the stale asset bundle on disk unless `flutter clean` is run. This change enhances `_needsRebuild` to compare the in-memory byte contents of non-`DevFSFileContent` assets against the existing files on disk, triggering an asset bundle rebuild if any generated metadata file is missing or contains different bytes. Fixes #128563
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the asset bundle rebuild check in TestCommand to be asynchronous and adds a comparison between generated asset entries and files on disk. A test has been added to verify rebuild behavior when the asset manifest is stale. The review feedback suggests optimizing this comparison by checking file lengths before reading file contents into memory.
…length before reading content
dcharkes
previously approved these changes
Nov 17, 2026
…st_test.dart
Updates the `TestCommand` construction in the stale `AssetManifest.bin` rebuild test in `packages/flutter_tools/test/commands.shard/hermetic/test_test.dart` to pass the required `assetBundleFactory` parameter added on `master`.
Previous output:
```
Analyzing test_test.dart...
error - test_test.dart:1822:27 - The named parameter 'assetBundleFactory' is
required, but there's no corresponding argument. Try adding the
required argument. - missing_required_argument
1 issue found.
```
Current output:
```
Analyzing test_test.dart...
No issues found!
```
dcharkes
approved these changes
Nov 18, 2026
auto-submit Bot
pushed a commit
to flutter/packages
that referenced
this pull request
Nov 19, 2026
flutter/flutter@06f32f8...e8cc6f3 2026-11-19 [email protected] Roll Skia from 280e0965687d to 3dfb69d709c7 (1 revision) (flutter/flutter#196970) 2026-11-19 [email protected] Update outdated `_formattedValues` documentation (flutter/flutter#195765) 2026-11-19 [email protected] [Impeller] Fix Vulkan GPU frame time metrics in benchmarks (flutter/flutter#196339) 2026-11-19 [email protected] Windows: Enable D3D11 multithread protection on ANGLE's device (flutter/flutter#196897) 2026-11-19 [email protected] Roll Skia from 7356c7627e87 to 280e0965687d (1 revision) (flutter/flutter#196957) 2026-11-19 [email protected] Roll Dart SDK from 091f346ad95c to d8d40cf9c21b (2 revisions) (flutter/flutter#196949) 2026-11-19 [email protected] Roll Skia from 73b9219fd1fa to 7356c7627e87 (4 revisions) (flutter/flutter#196951) 2026-11-19 [email protected] Roll Skia from 7bca23228537 to 73b9219fd1fa (1 revision) (flutter/flutter#196948) 2026-11-19 [email protected] [libimpeller] Fix swapped x and y glyph coordinates (flutter/flutter#196552) 2026-11-19 [email protected] [ios][spm]When using cocoapods plugin, give instruction that plugins may just need update (flutter/flutter#195853) 2026-11-19 [email protected] [web] Let the browser handle Control+wheel zoom outside of macOS (flutter/flutter#193362) 2026-11-19 [email protected] Fix focus violation when canRequestFocus set to false for all siblings in same build (flutter/flutter#191536) 2026-11-19 [email protected] Roll Skia from 9fc4f9e23d56 to 7bca23228537 (10 revisions) (flutter/flutter#196941) 2026-11-19 [email protected] Roll Dart SDK from 753488ede427 to 091f346ad95c (2 revisions) (flutter/flutter#196940) 2026-11-19 [email protected] iOS: Convert platform views to points with the frame's pixel ratio (flutter/flutter#196858) 2026-11-19 [email protected] [engine] Defer default font manager resolution to first use for platforms that have a prefetching API only (flutter/flutter#196377) 2026-11-18 [email protected] [flutter_tools] Add example app to package template and decouple platform configurations (flutter/flutter#192441) 2026-11-18 [email protected] [flutter_tools] Rebuild asset bundle when generated manifest content changes (flutter/flutter#191638) 2026-11-18 [email protected] Roll Skia from b11d69796f71 to 9fc4f9e23d56 (2 revisions) (flutter/flutter#196909) 2026-11-18 [email protected] [flutter_tools] Bump cupertino_icons to ^2.0.0 in app and module templates (flutter/flutter#196828) 2026-11-18 [email protected] Update iOS plugin language instructions (flutter/flutter#196614) 2026-11-18 [email protected] iOS: Add tests for rounded rect clips with per-corner/elliptical radii (flutter/flutter#196854) 2026-11-18 [email protected] Revert: [flutter_tools] Migrate lib/runner.dart off runInContext and overrides (flutter/flutter#196926) 2026-11-18 [email protected] Revert: Move macOS desktop builds to ThinLTO (flutter/flutter#196917) 2026-11-18 [email protected] [FGP] Offset split-APK versionCodes from a manifest-only versionCode (flutter/flutter#196561) 2026-11-18 [email protected] [flutter_tools] Migrate lib/runner.dart off runInContext and overrides (flutter/flutter#196387) 2026-11-18 [email protected] docs: remove broken image references from dev/snippets/README.md (flutter/flutter#195587) 2026-11-18 [email protected] Remove the FGP AGP-public-API migration coordination docs (flutter/flutter#196733) 2026-11-18 [email protected] [web] Skip stale safeBlur focus transfer when the element was refocused (flutter/flutter#196550) 2026-11-18 [email protected] Roll Skia from 81ee7327e81c to b11d69796f71 (4 revisions) (flutter/flutter#196900) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
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.
In
flutter test, the tool checks if the unit test asset bundle needs to be rebuilt by comparing the last modified timestamp ofAssetManifest.binagainstpubspec.yamland physical asset files. However, when Flutter changes the schema or generated content ofAssetManifest.binor other synthetic asset metadata (such asFontManifest.jsonorNOTICES) without changes topubspec.yamlor physical asset timestamps, tests continue using the stale asset bundle on disk unlessflutter cleanis run.This change enhances
_needsRebuildto compare the in-memory byte contents of non-DevFSFileContentassets against the existing files on disk, triggering an asset bundle rebuild if any generated metadata file is missing or contains different bytes.Fixes #128563