Hey folks,
What
It'd be nice to have an option on Rustler that allows me to define the "output" path of the compilation, which is currently hard-coded to priv/native/{crate}.
Why
I frequently compile my NIFs inside a Linux devcontainer for development but run my tests from my host system (macOS), so I frequently need to delete the compiled output and recompile it for another OS. I have a small workaround which copies the output to priv/native/{arch}/{crate} and then updates the load_from path to load_from: {:my_app, "priv/#{MyApp.Native.lib_dir()}/some_crate"}.
I added this compiler step in mix.exs like this: compilers: [:phoenix_live_view] ++ Mix.compilers() ++ [:app_native], and a module in mix/tasks/compile/app_native.ex which copies the artifacts into the subdirs in priv/native but ideally, I could do this with a Rustler option like I already do with load_from
Much appreciated! ❤️
Hey folks,
What
It'd be nice to have an option on Rustler that allows me to define the "output" path of the compilation, which is currently hard-coded to
priv/native/{crate}.Why
I frequently compile my NIFs inside a Linux devcontainer for development but run my tests from my host system (macOS), so I frequently need to delete the compiled output and recompile it for another OS. I have a small workaround which copies the output to
priv/native/{arch}/{crate}and then updates theload_frompath toload_from: {:my_app, "priv/#{MyApp.Native.lib_dir()}/some_crate"}.I added this compiler step in
mix.exslike this:compilers: [:phoenix_live_view] ++ Mix.compilers() ++ [:app_native],and a module inmix/tasks/compile/app_native.exwhich copies the artifacts into the subdirs inpriv/nativebut ideally, I could do this with a Rustler option like I already do withload_fromMuch appreciated! ❤️