Bulding Elixir app for Windows on Linux (missing elixir.bat)

I need to build an Elixir app release for Windows platform on Linux. This build should be self-contained and should not have Elixir installed on Windows machine.

I tried running command mix release but it only generate file env.bat and skipping the elixir.bat and iex.bat. Where do I find these files or how do I generate it properly?

$ mix release
* assembling prod-0.1.0 on MIX_ENV=dev
* skipping runtime configuration (config/runtime.exs not found)
* creating _build/dev/rel/prod/releases/0.1.0/vm.args
* creating _build/dev/rel/prod/releases/0.1.0/remote.vm.args
* creating _build/dev/rel/prod/releases/0.1.0/env.sh
* creating _build/dev/rel/prod/releases/0.1.0/env.bat
* skipping elixir.bat for windows (bin/elixir.bat not found in the Elixir installation)
* skipping iex.bat for windows (bin/iex.bat not found in the Elixir installation)

You have to generate releases on the same architecture/platform as the target. So for windows, you will need to build on windows. mix release doesn’t cross-compile. Search for “cross-compile” in the official docs at mix release — Mix v1.13.4 and you will get an explanation.

1 Like

Yeah to elaborate on what @mindok said, this is specifically not supported by mix release mix release — Mix v1.13.4

Currently, there is no official way to cross-compile a release from one target triple to another, due to the complexities involved in the process.