Are releases cross-platform so that I can build a release on one platform, and run it as it is on another or should I build on the same platform on which I am going to run the app?
Releases mechanism requires at least additional work to be made to make it cross-platform
While Erlang beams
are cross-platform, releases usually contain additional data that can be platform dependent.
It is
If you want to build release for Linux at Mac, you'll at least will need Erts build for Linux. If you are using relx
, for example, you'll have to specify it with
{include_erts, "/path/to/erlang"},
{system_libs, "/path/to/erlang"},
Additional platform-dependent libraries is a different story. Almost every complicated Erlang application use some NIFs or Ports, that are usually come with release and sit in priv
s. If you use any, you'll have to cross-compile them for your target platform. You'll have to handle it by yourself probably
Provided that those platforms have same OTP version: Yes .beam
files should be compatible across platforms because it's the Erlang VM that interprets the bytecode. Just like .class
files and JVM.
For platforms with different versions, it's backwards compatible with 2 major releases. Means if you made a release on a OS X machine with R16B, it should be compatible to any machines running OTP 17 and 18. Source
Both cases however doesn't apply to compiled native code or NIFs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With