[native assets] Use AddDllDirectory
on native assets dir(s) to enable dynamic linking
#56551
Labels
area-native-interop
Used for native interop related issues, including FFI.
os-windows
P2
A bug or feature request we're likely to work on
Milestone
To make dynamic linking between native assets possible (a dll opening another dll at runtime because they have been linked at build) on Windows, we need to specify where the dynamic linked dlls can be found.
To know the directory (or directories), we should probably add that info to
native_assets.yaml
. Then the embedder (Dart standalone or Flutter) who's bundling the native assets mapping can also specify the dll directories instead of trying to guess in the VM or in the embedder without knowing what command is being run. And the most natural time to add the dll directories would probably be just before loading the first dll we're loading with@Native external
functions. For keeping the responsibilities in the right place, it should probably be done as another callback inNativeAssetsApi
that the VM calls before the first dlopen. (Relevant code: https://dart-review.googlesource.com/c/sdk/+/361881 )Originally posted by @blaugold in dart-lang/native#190 (comment)
Originally posted by @dcharkes in dart-lang/native#190 (comment)
Adding a tracking issue for the Dart SDK work.
The text was updated successfully, but these errors were encountered: