OCaml 5 build failure on MacOS
purcell opened this issue · 11 comments
I tried getting an OCaml 5 on aarch64-darwin
using this overlay, but encounter a build failure. Any idea whether it's a known issue/limitation with the overlay, or with upstream support for these machines?
Flake:
{
description = "foo";
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
ocaml-overlay = {
url = "github:nix-ocaml/nix-overlays";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, flake-utils, ocaml-overlay }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ocaml-overlay.overlays.default]; };
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs.ocaml-ng.ocamlPackages_5_0; [ ocaml ];
};
}
);
}
Failure:
error: builder for '/nix/store/hlhq92xxm9kd3n5xfcmgkqxq5qndc9gy-ocaml+flambda-5.0.0.drv' failed with exit code 2;
last 10 log lines:
> Error: I/O error: dllunix.so_The boot compiler cannot load DLLs: No such file or directory
> make[4]: *** [Makefile:166: ../ocamldoc/ocamldoc] Error 2
> make[4]: Leaving directory '/private/tmp/nix-build-ocaml+flambda-5.0.0.drv-0/ocaml-5.0.0/ocamldoc'
> make[3]: *** [Makefile:1163: ocamldoc] Error 2
> make[3]: Leaving directory '/private/tmp/nix-build-ocaml+flambda-5.0.0.drv-0/ocaml-5.0.0'
> make[2]: *** [Makefile:313: all] Error 2
> make[2]: Leaving directory '/private/tmp/nix-build-ocaml+flambda-5.0.0.drv-0/ocaml-5.0.0'
> make[1]: *** [Makefile:328: bootstrap] Error 2
> make[1]: Leaving directory '/private/tmp/nix-build-ocaml+flambda-5.0.0.drv-0/ocaml-5.0.0'
> make: *** [/nix/store/0rawfy9g1y4c2h4s60sjm6m80cri92n3-Makefile.nixpkgs:15: nixpkgs_world_bootstrap_world_opt] Error 2
For full logs, run 'nix log /nix/store/hlhq92xxm9kd3n5xfcmgkqxq5qndc9gy-ocaml+flambda-5.0.0.drv'.
error: 1 dependencies of derivation '/nix/store/pkxbhi6a836hs25m9b2h3xsj90n7s667-nix-shell-env.drv' failed to build
Full log: https://gist.github.com/purcell/22c016df4c572d8139f847bbb37326bc
This is a non deterministic build failure. I suspect it’s related to concurrency. If you try again it’ll eventually compile.
Whoah, yes, confirmed after about 5 attempts. Thanks, at least I can use it now!
I haven’t seen this in a while, and I wonder if 5.1 suffers from it. We have ocamlPackages_5_1 here with the alphas if you wanna try that
It worked first time with ocamlPackages_5_1
, for what it's worth, though the load on the machine was a bit heavier while I was building it, so you never know.
Are we advertising our cache enough?. because OCaml 5 should definitely be in there
If you have a cache, maybe you could include it in the nixConfig
of the flake?
Yeah it’s there. https://github.com/nix-ocaml/nix-overlays/blob/master/flake.nix#L4
We don’t cache arm64 artifacts though.
Oh right, yeah, just checked after I wrote my comment, sorry. I'm on aarch64-darwin, so I don't really expect auto-populated caches tbh, since Github Actions rarely run on that platform.
And that’s actually a good hint, I suspect we’ve only seen this failure on arm64.
It never shows up in CI
@purcell the new buildPhase
for OCaml should fix this.
the reason why this isn't present in upstream nixpkgs is because we enable flambda by default, which seems required to trigger it (see ocaml/ocaml#13021).
Nice, thanks for the update, and for your continued work on this stuff!