Skip to content
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

[native_assets] The native assets mapping should use kernel concatenation in AOT #55377

Closed
dcharkes opened this issue Apr 4, 2024 · 0 comments
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. dart-cli-build

Comments

@dcharkes
Copy link
Contributor

dcharkes commented Apr 4, 2024

We'd like to support adding new assets in link hooks.

Use cases:

  • The build hook outputting a static library and then the link hook making a dynamic library of it.
  • Combining multiple assets into one.

Because the link hooks are run after kernel compilation, that will require using kernel concatenation instead of passing in the native asset mapping before kernel compilation.

This will require adding kernel concatenation support for AOT:

@dcharkes dcharkes self-assigned this Apr 4, 2024
@vsmenon vsmenon added area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. and removed area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. labels Apr 4, 2024
@bkonyi bkonyi added area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. dart-cli-build and removed pkg-dartdev labels Apr 4, 2024
copybara-service bot pushed a commit that referenced this issue Apr 11, 2024
The kernel_front_end will now allow passing in no Dart main program
when compiling a native-assets file.

The test now tests concatenating the dill files.

(A follow up CL will attempt the same for AOT dills.)

TEST=tests/ffi/native_assets/asset_relative_test.dart

Bug: #55377
Change-Id: Icbc6ab87d0015809f978966914064dbc6ab564a1
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
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362340
Reviewed-by: Tess Strickland <sstrickl@google.com>
copybara-service bot pushed a commit that referenced this issue Apr 11, 2024
gen_snapshot can now consume a concatenated dill file.

Restrictions:
* The first dill file must be the main program.
* The subsequent dill files must only contain dummy libraries with
  objects which are recognized classes in the VM and not treeshaken
  in the main program.

This will enable compiling Dart AOT first, then using the tree-shaking
information to tree-shake native assets, and then embedding the native
assets mapping in the kernel file before running gen_snapshot.

TEST=tests/ffi/native_assets/asset_relative_test.dart

Closes: #50152
Bug: #55377
Change-Id: Id562aa39840d5eb467198efaa4cf3152d860f8b5
q-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
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/362381
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
@dcharkes dcharkes changed the title [native_assets] The native assets mapping should use kernel concatenation [native_assets] The native assets mapping should use kernel concatenation in AOT Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. dart-cli-build
Projects
None yet
Development

No branches or pull requests

3 participants