You can use Docker to do a cross-compilation. I build my releases with GitHub Actions that provide Ubuntu runners as it’s more a convenient way for me.
Releases were always bound to the architecture they’re built on. Even if you used mac os on an intel mac you couldn’t run releases built on it on an ubuntu host.
And what about uploading the code to the Linode server and make a build there? How slow will the compilation process be? A minute or two? Will it slow down the server that has running website already in Phoenix? Or I can use blue green deployment with two servers if that will be a problem.
Isn’t there some cross-compilation tool by the Elixir team to mitigate this M1 Mac issue? Have they mentioned that they are working on it?
I don’t want to use Docker. I hate it. Also I don’t host stuff on Github or gitlab, I version stuff only locally for security and legal issues. Any idea what can I do in such case? Upload the project files to the Linode server that has Erlang VM and Elixir installed and make a release build there?
You do not need Docker, you can use any other setup that will:
Provide compiled ERTS for the target platform (unless you compile your release without ERTS, but then you need to ensure that on the target host there is ERTS in exactly the same version you compiled your project with, also this will not allow you to do hot upgrades)
If you have NIFs: provide compiler that will build NIFs for target platform (you can try Zig for example to do so)
Just to be clear, you can just build your application in Docker, extract it from the build container as a compressed archive, upload it to your host and unpack. You don’t have to run it as a Docker container on your host
You run compilation under emulation for work? I’d imagine there is no shortage of idle PCs lying around in a typical work environment for the build jobs.
Probably, but the company isn’t big, and I was on a much too tight a deadline to fiddle with my 4 idle laptops at home… Oh, and the 24/7 server.
It would be a very interesting project to try and have build infrastructure at home now that things have settled a bit.
Part of my duties is to build an Elixir release (including with Rust libraries) inside Docker and deploy it to a bunch of servers, yes, but that’s not a job description. Just one of the items in my job description as a senior dev.
I use a spare desktop pc for that. It is on 24/7 and accessible from anywhere via a reverse SSH tunnel. Current bottleneck is the uptime of home broadband, which is sadly only about 95%.