Open johanandren opened 11 months ago
Still not possible, I believe. Main issue is https://github.com/oracle/graal/issues/407
Currently need to build on the target platform. Can build for another arch in docker, but found the native image build didn't perform well under emulation. For the Kalix native image build, I used docker buildx with remote builder nodes. Can see notes on this here (lightbend private).
I'll PR just mentioning that for now then, can't be done locally, remote builder possible, without digging deeper into documenting and users will have to figure out the details of remote buildx builders themselves.
Ah, I see you already mentioned it in #2094 👍
Edit: that was the internal build. But maybe I can steal some text from there.
Adding some notes on how to cross-build using docker buildx, and pointers to remote builder nodes, sounds good.
For creating binaries in CI, there's an official github action for GraalVM, and that's the currently suggested approach for cross-platform builds: https://github.com/marketplace/actions/github-action-for-graalvm
If possible.
Right now building the graalvm samples on Apple M1/2 will result in an ARM64 image, but that is maybe not that likely to be available in cloud/edge envs.
I got as far as learning that there may be a
--target
flag when building the native image, but I would think that requires a GraalVM installation for the target platform as well or something?