Closed
Description
The native assets builder should take into account pub workspaces:
-
.dart_tool/package_config.json
is to possibly be in a ancestor directory -
runPackageName
argument should be required for build/link hooks, so only native assets that are a dependency are built (instead of all packages in the package resolution of the whole workspace). -
runPackageName
argument should be required for "if there are packages with native assets", the native assets experiment only has to be enabled if a dependency has a hook. - Native assets should be shared for the whole workspace. (The package resolution is identical, so the native assets should be identical.) I need to check if no information leaks from
runPackageName
into theBuildInput
.
And this needs to be rolled into
- Dart-dev (first release after https://dart-review.googlesource.com/c/sdk/+/405360, the first release after https://github.com/dart-lang/sdk/releases/tag/3.8.0-28.0.dev)
- Flutter-master (immediately after [native assets] Roll dependencies flutter/flutter#162017)
Yet another CI issue: Testing native_assets_ci/example/build/native_dynamic_linking.dart
fails:
PathNotFoundException: Cannot open file, path = 'D:\a\native\native\pkgs\native_assets_cli\example\build\native_add_app\.dart_tool\package_config.json' (OS Error: The system cannot find the file specified.
That's because the native_assets_builder
package itself doesn't understand workspaces:
static Future<PackageLayout> fromRootPackageRoot(
FileSystem fileSystem,
Uri rootPackageRoot,
) async {
rootPackageRoot = rootPackageRoot.normalizePath();
final packageConfigUri =
rootPackageRoot.resolve('.dart_tool/package_config.json'); // <--
assert(await fileSystem.file(packageConfigUri).exists());
final packageConfig = await loadPackageConfigUri(packageConfigUri);
return PackageLayout._(
fileSystem, rootPackageRoot, packageConfig, packageConfigUri);
}
Originally posted by @Levi-Lesches in #1884 (comment)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done