ocaml / ocaml/dune

Allow building via Flake on `aarch64-linux`

Open
#15,411 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

nix
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Desired Behavior

If I run nix build .#dune-static (or .#dune) on Ubuntu 20.04 on ARM I would want Dune to build. It currently fails because it can't find a matching C compiler.

Example

nix build .#dune-static
building '/nix/store/1gp9cay6pccy1208vm2qik2ppcn8824j-ocaml+flambda-x86_64-unknown-linux-musl-5.4.1.drv'...
error: Cannot build '/nix/store/1gp9cay6pccy1208vm2qik2ppcn8824j-ocaml+flambda-x86_64-unknown-linux-musl-5.4.1.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/mxrj4fgpa6ifzbqh7pbrsbm3jml046vc-ocaml+flambda-x86_64-unknown-linux-musl-5.4.1
       Last 25 log lines:
       > checking whether stripping libraries is possible... yes
       > checking if libtool supports shared libraries... yes
       > checking whether to build shared libraries... yes
       > checking whether to build static libraries... yes
       > checking if x86_64-unknown-linux-musl-gcc generates a .note.GNU-stack section... yes
       > checking if x86_64-unknown-linux-musl-gcc generates .size and .type asm directives... yes
       > checking how to run the C preprocessor... x86_64-unknown-linux-musl-gcc -E
       > checking C compiler vendor... gcc-15-2
       > checking whether target executables can be run in the build... no
       > checking whether #! works in shell scripts... yes
       > checking whether the C compiler accepts -Wold-style-declaration... yes
       > checking whether the C compiler accepts -Wimplicit-fallthrough=5... yes
       > checking for flexdll sources... checking for flexdll.h... no
       > configure: detecting the C toolchain for build
       > checking for aarch64-unknown-linux-musl-gcc... no
       > checking for gcc... no
       > checking for aarch64-unknown-linux-musl-cc... no
       > checking for cc... no
       > checking for aarch64-unknown-linux-musl-cl.exe... no
       > checking for cl.exe... no
       > checking for aarch64-unknown-linux-musl-clang... no
       > checking for clang... no
       > configure: error: in `/build/source':
       > configure: error: no acceptable C compiler found in $PATH
       > See `config.log' for more details
       For full logs, run:
         nix log /nix/store/1gp9cay6pccy1208vm2qik2ppcn8824j-ocaml+flambda-x86_64-unknown-linux-musl-5.4.1.drv
error: Cannot build '/nix/store/r154ay8a9sp7sknmmad690y58si51inx-dune-x86_64-unknown-linux-musl-3.23.1.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/xynwzl8mi5l3b860y82vp5zgyz0f57mr-dune-x86_64-unknown-linux-musl-3.23.1
error: Cannot build '/nix/store/hgnc08jsdfm6489w7imxpdchaslap7jr-ocaml5.4.1-findlib-x86_64-unknown-linux-musl-1.9.8.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/cvdml64cmlcjzd17iyfwx95j0i09lcvb-ocaml5.4.1-findlib-x86_64-unknown-linux-musl-1.9.8
error: Build failed due to failed dependency

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing nix build .#dune-static or .#dune on Ubuntu 20.04 running on ARM and inspect the reported Nix build log. Trace the flake entry and toolchain configuration involved in selecting the C compiler for aarch64-linux; done means both targets build successfully on that platform.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.