Unreviewed changes
5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: pkg/dart2wasm/lib/compile.dart
Insertions: 2, Deletions: 3.
@@ -274,9 +274,8 @@
final contents =
File.fromUri(resolvedDynamicInterfaceUri!).readAsStringSync();
final dynamicInterfaceYamlFile = DynamicInterfaceYamlFile(contents);
- additionalSources = dynamicInterfaceYamlFile.libraries
- .where((String lib) => !lib.startsWith('dart:'))
- .map((String lib) => dynamicInterfaceUri.resolve(lib))
+ additionalSources = dynamicInterfaceYamlFile
+ .getUserLibraryUris(dynamicInterfaceUri)
.toList();
}
}
```
```
The name of the file: pkg/front_end/lib/src/kernel/dynamic_module_validator.dart
Insertions: 5, Deletions: 0.
@@ -94,6 +94,11 @@
for (YamlList section in [?extendable, ?canBeOverridden, ?callable])
for (YamlNode item in section) (item as YamlMap)['library'] as String,
};
+
+ // Coverage-ignore(suite): Not run.
+ Iterable<Uri> getUserLibraryUris(Uri baseUri) => libraries
+ .where((String lib) => !lib.startsWith('dart:'))
+ .map((String lib) => baseUri.resolve(lib));
}
/// Parsed dynamic interface specification yaml file.
```
```
The name of the file: pkg/vm/lib/kernel_front_end.dart
Insertions: 5, Deletions: 8.
@@ -642,19 +642,16 @@
args.environmentDefines,
);
- // Make a copy to ensure it is mutable.
- final additionalSources = List.of(args.additionalSources);
-
+ List<Uri> additionalSources = args.additionalSources;
final dynamicInterface = args.dynamicInterface;
if (dynamicInterface != null) {
final fileUri = await asFileUri(args.options!.fileSystem, dynamicInterface);
final contents = File(fileUri.toFilePath()).readAsStringSync();
final dynamicInterfaceYamlFile = DynamicInterfaceYamlFile(contents);
- additionalSources.addAll(
- dynamicInterfaceYamlFile.libraries
- .where((String lib) => !lib.startsWith('dart:'))
- .map((String lib) => dynamicInterface.resolve(lib)),
- );
+ additionalSources = [
+ ...additionalSources,
+ ...dynamicInterfaceYamlFile.getUserLibraryUris(dynamicInterface),
+ ];
}
CompilerResult? compilerResult;
```
Change information
Commit message:
[dyn_modules] Compile all libraries mentioned in dynamic_interface.yaml
All libraries exported via dynamic_interface.yaml (except 'dart:'
libraries) are now always compiled, as if they were specified
using --source flag on the gen_kernel / frontend_server command line.
This makes sure that exported libraries would be available for
dynamic modules even if they are not used in the host app.
TEST=pkg/dynamic_modules/test
Fixes b/452833638
Change-Id: I513a75bea76a18a3591613ecd68e7307e66a7c24
Files:
- M pkg/dart2wasm/lib/compile.dart
- M pkg/dynamic_modules/test/data/const_constructor/main.dart
- M pkg/dynamic_modules/test/data/extend_class3/main.dart
- M pkg/dynamic_modules/test/data/extend_class4/main.dart
- M pkg/dynamic_modules/test/data/extension_type/main.dart
- M pkg/dynamic_modules/test/data/extension_type2/main.dart
- M pkg/dynamic_modules/test/data/mixin_deduplication/main.dart
- M pkg/dynamic_modules/test/data/mixin_field/main.dart
- M pkg/front_end/lib/src/api_prototype/dynamic_module_validator.dart
- M pkg/front_end/lib/src/kernel/dynamic_module_validator.dart
- M pkg/vm/lib/kernel_front_end.dart
Change size: M
Delta: 11 files changed, 107 insertions(+), 40 deletions(-)
Branch: refs/heads/main
Submit Requirements:
Code-Review: +1 by Nate Biggs, +1 by Johnni Winther, +1 by Sigmund Cherem