9588927faf
This CL moves native assets resolution to the embedder. The Dart VM looks up the asset path (for example `['relative', 'foo.so']`) with the asset id. The embedder defines callbacks for asset loading, and returns a handle to the dylib. Then the VM calls the embedder again with `dlsym` to lookup the symbol. The Dart VM & kernel compiler are responsible for the asset id to asset path mapping. The kernel compiler compiles it into the snapshot and the VM looks it up in the snapshot. Relative paths are resolved relative to the isolate script uri (kernel snapshot, jit snapshot, aot snapshot, or `dart compile exe` result). The embedder is responsible for remembering the script uri it set when spawning the isolate group. This CL does not add `dlclose` or `dladdr` embedder callbacks yet. Bug: https://github.com/dart-lang/sdk/issues/55521 Bug: https://github.com/dart-lang/sdk/issues/55966 TEST=pkg/dartdev/test/native_assets/build_test.dart TEST=tests/ffi/native_assets/asset_relative_test.dart Bug: https://github.com/dart-lang/sdk/issues/55410 Bug: https://github.com/dart-lang/sdk/issues/55523 Bug: https://github.com/dart-lang/sdk/issues/55207 Change-Id: I75ec4a368c5fb3d2f76b03771e796ff56bcac941 Cq-Include-Trybots: dart/try:vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-mac-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-win-debug-arm64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-win-release-arm64-try,vm-aot-asan-linux-release-x64-try,vm-asan-linux-release-x64-try,vm-aot-msan-linux-release-x64-try,vm-msan-linux-release-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/361881 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com>
Dart CLI tooling
A command-line utility for Dart development.
Usage: dart [vm-options] <command|dart-file> [arguments]
Global options:
-h, --help Print this usage information.
-v, --verbose Show additional command output.
--version Print the Dart SDK version.
--enable-analytics Enable analytics.
--disable-analytics Disable analytics.
Available commands:
analyze Analyze the project's Dart code.
compile Compile Dart to various formats.
create Create a new project.
format Idiomatically format Dart source code.
pub Work with packages.
run Run a Dart program.
test Run tests in this package.
Run "dart help <command>" for more information about a command.
See https://dart.dev/tools/dart-tool for detailed documentation.
Contributing
If you'd like to contribute to the Dart CLI tool, please start by reading the contribution guidelines for the Dart project. Then familiarize yourself with the design principles that guide this tool's UX.
Features and bugs
Please file feature requests and bugs in the Dart SDK issue tracker
with label area-dart-cli.