How to cross-release and upgrade?

Hey guys,

I have thousands of arm64 based IoT devices in end users home running armbian (systemd based). And an elixir based agent.

The trouble is:

  1. I do the development on my x86 based linux (also I have m1pro based macos), How could I cross compile my code to armv8 binary?
  2. When I want an OTA for my agent, I have to download/extract the release directory and then call the systemd restart agent.service. Is it possible to compile my project into a single file to make upgrading process easier?
  1. Unfortunately elixir doesn’t have great cross compile tooling like golang has, but thanks to docker we don’t need great tooling to have an easy way to cross compile.
    Faster Multi-Platform Builds: Dockerfile Cross-Compilation Guide | Docker

  2. Yes, Bakeware — bakeware v0.2.4, but be aware that they claim that they aren’t production ready.

1 Like

Cross compilation is a hard topic because in most cases libraries that contain code that needs to be compiled natively have their custom Makefile, this shifts the responsibility to the developer of the library/codebase to ensure cross-compilation of the project.

If we talk about pure erlang/elixir code, it works out of the box on all platforms as long as you have the runtime compiled for the correct architecture.


Bakeware seems great! Thank you!