Building for Windows with burrito, with sqlite3, Nx, Exla, etc

I’m trying out burrito. It seems to fit my needs to cross-compile a Phoenix application into a single self-extracting binary for Windows.

Are there any problems to be expected with dependencies that are not written in Elixir? I see there are solutions for NIF based dependencies (I’m not an expert at all on this matter!). I’m not sure how transparently this is handled (and if it’s a good idea in the first place).

I’m thinking of these dependencies in particular:

  • sqlite3 adapter
  • Nx, Exla, Explorer, etc. (e.g. the typical dependencies to run inference on a neural network). This could also fallback to a non-accelerated version of the inference, without GPU support, but at least Nx should be available.

Or more in general: what will make a non-Elixir dependency compile successfully for Windows, with burrito? Or are all such dependencies expected to just work out of the box?

If you’re wanting to compile on a Windows machine:

You need Visual Studio Build Tools or Visual Studio installed.

scoop install coreutils make 7zip xz zig. If you don’t use scoop, install those things some other way.

Build from inside the Developer Command Prompt, which should become available as an option in Terminal after installing VS/VS Build Tools. If you don’t use Terminal then a) you should and b) find that shortcut - I think it shows up in the start menu.

I’m not sure how many of the Nx libraries will compile on Windows though.

Thx for the heads up.

I don’t necessarily want to build on Windows as the host platform, but rather want to compile for Windows as the target platform. The host can be macos or Linux.

Since most of thr Nx related libraries require some kind of binding to another language, I suspect this might not be smooth ride.

Righto. I think that is easier but I’m sure I’ve seen Jonaton mention that some things in the Nx ecosystem just won’t work on Windows. Best of luck :crossed_fingers:

2 Likes