Skip to content

Add aarch64-unknown-linux-musl target#232

Open
frejsoya wants to merge 4 commits into
ocaml-dune:mainfrom
frejsoya:add-aarch64-linux-musl
Open

Add aarch64-unknown-linux-musl target#232
frejsoya wants to merge 4 commits into
ocaml-dune:mainfrom
frejsoya:add-aarch64-linux-musl

Conversation

@frejsoya

@frejsoya frejsoya commented Jun 15, 2026

Copy link
Copy Markdown

Static dune binaries (musl) for ARM64 Linux.

@frejsoya frejsoya force-pushed the add-aarch64-linux-musl branch from ebc522e to 0b09c50 Compare June 15, 2026 09:33
@frejsoya frejsoya marked this pull request as draft June 15, 2026 09:33
@frejsoya frejsoya force-pushed the add-aarch64-linux-musl branch 2 times, most recently from 5af543d to aaa51df Compare June 15, 2026 09:35
@frejsoya frejsoya marked this pull request as ready for review June 15, 2026 09:39
@frejsoya frejsoya force-pushed the add-aarch64-linux-musl branch from aaa51df to b42b022 Compare June 15, 2026 09:41
@Leonidas-from-XIV

Copy link
Copy Markdown
Contributor

Good to see you, @frejsoya! We had an issue with the formatting but if you rebase your PR then that should work again.

Can you do a run on your fork to show that the ARM64 binary on Linux is successfully passing the test? It will fail to upload to our infrastructure but it would be good seeing that the produced binary is working.

@shonfeder shonfeder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

This looks OK to me, but I am not an expert on this set up.

I agree @Leonidas-from-XIV requests should be addressed before we merge.

We build static musl Dune binaries for x86_64 but not ARM64, so anyone
on Graviton, Ampere, or an Apple Silicon Linux VM is stuck building from
source. This adds the same static build for ARM64, running natively on
the ubuntu-22.04-arm runner.

Signed-off-by: Frej Soya <frej.soya@gmail.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
@Leonidas-from-XIV Leonidas-from-XIV force-pushed the add-aarch64-linux-musl branch from b42b022 to 52317f9 Compare July 2, 2026 08:45
Signed-off-by: Marek Kubica <marek@tarides.com>

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've forked and tested the action on my repo and somehow Nix fails to build the OCaml compiler because it can't find a C compiler, despite installing and detecting GCC 15.2. Weird.

@Leonidas-from-XIV

Copy link
Copy Markdown
Contributor

Ok, it seems like it is installing the amd64 compiler instead of the ARM64 one. I have a hard time figuring out why it would be doing that. On the ARM64 builds on macOS it installs the correct clang. Hmm.

@Leonidas-from-XIV

Copy link
Copy Markdown
Contributor

Turns out that the current way of building static binaries via Nix in Dune does not work on arm64, one needs to use a different toolchain than the musl64 one: ocaml/dune#15407.

However even with that change there's some flags missing and the resulting binary ends up not being a static binary, some more investigation and fixes are needed.

Given this is not my highest priority at the moment (lower than #237) I'll stop the investigation here for now. Picking it up at a later point in time should be pretty easy however.

@Leonidas-from-XIV Leonidas-from-XIV removed their assignment Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants