I do, AWS Graviton2 (t4g) and Graviton3 (m7g) and some Ampere Altra (no, not the full machine with 80 cores, only small VMs part of the huge machine) ![]()
Lot of other hosting companies are starting to show offerings using Ampere Altra, so things looks promising in that front! ![]()
Since I still use Intel/AMD for development, I use my own container based on musl (Alpine Linux) to build static versions of the applications to deliver them.
For that, I combine Crystal + zig cc and the static version of the libraries needed for aarch64 and use crystal build --cross-compile.
There are a few caveats:
- If your app depends on OpenSSL, you need to be careful as it will try to use pkg-config and point to your local version of OpenSSL instead of the target one (trick is to set
PKG_CONFIG_LIBDIRand point to the cross-compilationpkgconfigdirectory for aarch64. - Even that compiles successufly, there might be issues with OpenSSL across distros, as it will not be able to find
/etc/ssl/certsin some or find other issues. so far (
) static musl runs without issues on Ubuntu 22.04 LTS - Multi-threading is a bit flaky at this stage (
-Dpreview_mt), I donβt have concrete examples, but encountered random errors that are hard to reproduce.
I showed a little bit of this in a few videos here and here.
Iβve also prepacked a list of dependencies in magic-haversack repository, so you only need to download, extract and then combine with your local Crystal and zig compiler to produce those static binaries targeting aarch64-linux-musl.
I was hoping to do part 3 showing automated cross-compilation using GitHub Actions but got a bit trickier to generate MacOS binaries (due MacOSX SDK version mismatch). More to come on that at some point ![]()
Enjoy!