-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Add experimental data assets from hooks #164094
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
Conversation
5e36ce4
to
9a2f7e6
Compare
There seems to be a test failure related to the ordering of stdouts at https://github.com/mosuem/flutter/blob/rebaseMartinsDataAssets/packages/flutter_tools/test/integration.shard/overall_experience_test.dart#L123 - not sure if this is intentional or not. |
840b811
to
f71c5e9
Compare
The ordering of the patterns in Multiple(
<Pattern>[
RegExp(
r'^Reloaded 0 libraries in [0-9]+ms \(compile: \d+ ms, reload: \d+ ms, reassemble: \d+ ms\)\.$',
),
'called reassemble',
'called paint',
],
handler: (String line) {
processManager.killPid(pid, ProcessSignal.sigusr2);
return null;
},
), is not relevant. You can see how |
The root cause I believe is the modified code (which should be reverted - as mentioned earlier):
This |
079d1ad
to
08b1bde
Compare
packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart
Outdated
Show resolved
Hide resolved
7721ce5
to
5d27153
Compare
packages/flutter_tools/lib/src/build_system/targets/native_assets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/integration.shard/isolated/dart_data_asset_test.dart
Outdated
Show resolved
Hide resolved
20e240f
to
741ef51
Compare
packages/flutter_tools/lib/src/build_system/targets/native_assets.dart
Outdated
Show resolved
Hide resolved
8e0d321
to
8e028e2
Compare
@bkonyi I seem to be stuck debugging this. On windows,
fails - debugging prints show The other error also puzzles me - on macos,
fails - but only on CI, not reproducible locally on my mac. It seems to be some sort of Chrome crash, maybe a Chrome version thing? Also cc @mkustermann if you have any ideas.. |
Updating the dart-lang/native dependencies to the ones published today. No functional changes, but `CodeAsset` does not expose an `architecture` and `os ` anymore (dart-lang/native#2127). Instead these should be taken from what is passed in for the `CodeConfig`. This PR refactors the `DartBuildResult` to carry around the `Target` with `CodeAsset`s as `FlutterCodeAsset`s. (This PR avoid refactoring relevant code due to #164094 already refactoring this code.)
It looks like the
Yeah, I have no idea what's up for this one but it's definitely related to the Chrome crash. If could be an infra thing? cc @matanlurey @chingjun |
That's what I did earlier, where the
|
Sorry, must have missed that. That error is coming from the engine and can be reported when:
I'm guessing it's likely the first case. Since we provide the same path to // Shell::OnServiceProtocolRunInView
std::string asset_directory_path =
fml::paths::FromURI(params.at("assetDirectory").data());
// ...
configuration.AddAssetResolver(std::make_unique<DirectoryAssetBundle>(
fml::OpenDirectory(asset_directory_path.c_str(), false,
fml::FilePermission::kRead),
false)); vs // Shell::OnServiceProtocolSetAssetBundlePath
if (!asset_manager->PushFront(std::make_unique<DirectoryAssetBundle>(
fml::OpenDirectory(params.at("assetDirectory").data(), false,
fml::FilePermission::kRead),
false))) {
// The new asset directory path was invalid.
FML_DLOG(ERROR) << "Could not update asset directory.";
ServiceProtocolFailureError(response, "Could not update asset directory.");
return false;
} In Can you try patching // Shell::OnServiceProtocolSetAssetBundlePath
std::string asset_directory_path =
fml::paths::FromURI(params.at("assetDirectory").data());
if (!asset_manager->PushFront(std::make_unique<DirectoryAssetBundle>(
fml::OpenDirectory(asset_directory_path.c_str(), false,
fml::FilePermission::kRead),
false))) {
// The new asset directory path was invalid.
FML_DLOG(ERROR) << "Could not update asset directory.";
ServiceProtocolFailureError(response, "Could not update asset directory.");
return false;
} |
It seems it did not - the error message also stays the same. |
Hm, that's interesting... I think we'll need to add some logging, because this is likely something related to Windows paths. Can you add logging for the values of |
@bkonyi added the debug statements - feel free to add more if it helps! |
752eb87
to
d28cf11
Compare
@matanlurey @jtmcdole any idea why the chrome tests on mac are failing? |
d28cf11
to
3d6ab44
Compare
It seems the Chrome failure as reached linux as well, also not reproducible locally. |
abd0f6e
to
f51073b
Compare
packages/flutter_tools/lib/src/isolated/native_assets/targets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/isolated/native_assets/targets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/isolated/native_assets/targets.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/lib/src/isolated/native_assets/targets.dart
Outdated
Show resolved
Hide resolved
throw MissingDefineException(kAndroidArchs, 'native_assets'); | ||
} | ||
return androidArchsEnvironment.split(' ').map(getAndroidArchForName).toList(); | ||
case TargetPlatform.darwin: |
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.
Nit: remove non-Android targets and use default
.
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 would infringe on https://dart.dev/tools/linter-rules/no_default_cases
This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
2d20ea9
to
61fe9b6
Compare
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 onflutter build bundle
.The chrome sandbox is disabled as per #165664.
cc @bkonyi
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.