Search code examples
dartrustdart-pub

How can I use dart ffi properly in a pub package?


I am currently building a console package with Dart, and Rust using FFI(foreign function interface). Since I can't/shouldn't publish dll/so/dylib files, how can I add a build functionality to it. With that functionality, the required files should be built after the package is downloaded, so that the interop-ed code can work properly. How can it be done? Will the user that downloaded the package need to have Rust in his machine to build the files?


Solution

  • You need to either distribute binaries or require the user to have a Rust compiler.