-
Notifications
You must be signed in to change notification settings - Fork 470
All MirageOS unikernels fail to build: dune build fails to succeed (with select in a monorepo) #13299
Description
Thank you for improving Dune!
Expected Behavior
dune build should succeed
Actual Behavior
dune build fails with
dune build --profile release --root . ./dist
File "dune.build", line 17, characters 3-23:
17 | mirage-bootvar.solo5 mirage-crypto-rng-mirage mirage-kv-mem mirage-logs
^^^^^^^^^^^^^^^^^^^^
Error: Library "mirage-bootvar.solo5" in
_build/solo5/duniverse/mirage-bootvar/solo5 is hidden (optional with
unavailable dependencies).
Reproduction
Environment:
- OCaml 4.14.2
- dune 3.20.2
- mirage 4.10.4
Once you have an opam switch with the above, run:
- git clone https://github.com/mirage/mirage-skeleton.git
- cd mirage-skeleton/tutorial/hello
- mirage configure -t hvt
- make
You will observe the above error.
Looking deeper, this issue only appeared once lwt 6.0.0 came into the universe. Its src/core/dune file contains:
(libraries
(select lwt_rte.ml from
(lwt_runtime_events -> lwt_rte.with.ml)
(-> lwt_rte.without.ml))))
Now, mirage uses opam-monorepo to construct kind of a monorepo -- and here lwt (together with lwt_runtime_events) is present. I suspect dune attempts to use the first select case, and fails. Why on earth the error is about mirage-bootvar.solo5, I have no clue about.
Workarounds include:
- use lwt 5.9.2 (e.g. via opam pin)
- modify the src/core/dune by removing the line
lwt_runtime_events -> lwt_rte.with.ml
If you have any further questions, please don't hesitate from asking.
Affected are all MirageOS unikernels (since they use lwt), with a fresh enough opam-repository (where lwt 6.0.0 is around).