Skip to content

All MirageOS unikernels fail to build: dune build fails to succeed (with select in a monorepo) #13299

@hannesm

Description

@hannesm

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:

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions