dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.08k stars 1.56k forks source link

[ffi] Specifying external version, architecture and OS constraints #56639

Open dcharkes opened 1 week ago

dcharkes commented 1 week ago

The Dart SDK tracking issue for:

Flutter has a way to specify the OS API version and supported architectures (the native build files), and supported OSes (pubspec). We don't have the same for Dart.

Being able to do so would help with both the native assets work as well with packages using dart:ffi without native assets that have version, architecture or OS constraints.

  1. We could surface the info on pub.dev (https://github.com/dart-lang/pub-dev/issues/8010)
  2. We could check before dart run, dart compile, dart build that the constraints are satisfied.
dart-github-bot commented 1 week ago

Summary: Dart currently lacks a mechanism to specify external version, architecture, and OS constraints for FFI packages. This limits the ability to manage native assets and ensure compatibility across different platforms.