Hacker News new | ask | show | jobs
by greenarc 2122 days ago
We ended up building an ARM image with the OCaml compiler installed, running it with qemu to build our OCaml code as a second step.

Basically from yocto have a "rootfs" which is your standard image + gcc, use it to build a docker container or chroot in it, add qemu-arm-static, build the OCaml compiler from opam and then use it to build binaries. Not the most straightforward, but it works... fine. And in the end it's just a docker image like any other that is used to build our binaries.

With that said this has been running for a few years, I didn't check if upstream OCaml cross-compiling made progress since then.

1 comments

That's a pretty reasonable approach. We publish multiarch base images for OCaml/opam regularly (e.g. see `latest` at https://hub.docker.com/r/ocaml/opam2/tags or https://hub.docker.com/r/ocurrent/opam/tags for slimmer CI images).