Open dcharkes opened 2 months ago
@dcharkes If you have any idea what differences between embedders could cause loading the linked library to fail with standalone Dart, that would be very helpful for https://github.com/dart-lang/native/issues/1419.
A Flutter app has it's include path / rpath set. A Dart .exe from dart build exe
might not have that set yet. (Users using FFI have simply been using dlopen
calls with full paths until now. And that's what native assets use under the hood as well currently.)
When doing dart run
and dart test
the executable is dart.exe
in the Dart SDK. So that also doesn't have an include path / rpath. Maybe we can somehow provide that as an environment variable? Or maybe ensuring we run from the right working directory might help. This one might be slightly more tricky to get right than for dart build exe
.
We want to support dylibs being dynamically linked to other dylibs in native assets:
We have a working PR for Flutter:
But it's not working in Dart standalone out of the box either.
Originally posted by @blaugold in https://github.com/flutter/flutter/pull/153054#pullrequestreview-2233514300
We should add a similar integration test as in the Flutter PR with dylibs being dynamically linked to each other in pkg/dartdev/test/native_assets/build_test.dart and friends. (We could have the integration test project itself live on dart-lang/native instead of checking it in to the Dart SDK like we do with many other tests in pkg/dartdev/test/native_assets/.)