ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.63k stars 401 forks source link

gettext-camomile fails to build on nix (3.15.0~alpha1) #10317

Closed emillon closed 7 months ago

emillon commented 7 months ago

https://github.com/nix-ocaml/nix-overlays/actions/runs/8438106703/job/23120699845?pr=1349

Running phase: checkPhase
File "test/test-camomile/dune", line 2, characters 7-11:
2 |  (name test)
           ^^^^
(cd _build/default/test/test-camomile && ./test.exe -test-dir ../testdata)
Fatal error: exception File "src/configImpl.ml", line 1, characters 58-64: Assertion failed

error: builder for '/nix/store/pww9d1y40cp8im0ggsaw051j2v6j163q-ocaml4.14.2-gettext-camomile-0.4.2.drv' failed with exit code 1;
       last 15 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/rz68lchjc6v1i9p1cahqlhvif4acfpsr-source
       > source root is source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > Running phase: checkPhase
       > File "test/test-camomile/dune", line 2, characters 7-11:
       > 2 |  (name test)
       >            ^^^^
       > (cd _build/default/test/test-camomile && ./test.exe -test-dir ../testdata)
       > Fatal error: exception File "src/configImpl.ml", line 1, characters 58-64: Assertion failed
       >
       For full logs, run 'nix log /nix/store/pww9d1y40cp8im0ggsaw051j2v6j163q-ocaml4.14.2-gettext-camomile-0.4.2.drv'.
emillon commented 7 months ago

Definitely a dune-site issue:

let get_path site = match site with [path] -> path | _ -> assert false
emillon commented 7 months ago

Maybe not a dune-site issue actually! bisected to 2e11cbd8079ca44de92ed778e40ae2ef34501da4 (#10275)

emillon commented 7 months ago

debugging notes:

next step is trying to see the diff in installed files to see if it's truncation or something else.

emillon commented 7 months ago

Actually removing if executable works, I'll send a PR

jchavarri commented 7 months ago
  • this is reproducible on nix, but not on opam, because dune install is not used by opam

Not sure if this helps, but in Ahrefs case it failed using opam, not nix. Ahrefs uses a custom opam setup with a couple of local opam mirrors and multiple "meta" opam packages in a monorepo, maybe that affects the result somehow.

emillon commented 7 months ago

interesting, thanks. to clarify, I meant in the context of reproducing the issue, but it seems that a similar failure happened in the context of opam as well (in some cases dune install is actually used in build instructions). are you able to easily test if https://github.com/ocaml/dune/pull/10327 fixes the issue? (otherwise, it will be part of a alpha2 in the next few days)

jchavarri commented 7 months ago

https://github.com/ocaml/dune/pull/10327 works, camomile 2.0.0 installed correctly 🎉 thanks!