Dune build @doc producing empty index

EDIT: solved it right after posting. I forgot the (public_name ...) field in the dune file.

Hi, when I run dune build @doc locally I get a empty index, as can be seen here: https://yawaramin.github.io/ocaml-decimal/api/decimal/index.html

The package decimal has the following layout:

decimal.opam
dune-project
  (lang dune 2.7)
  ...
  (package
    (name decimal)
    ...)
lib/
  calc.ml
  decimal.ml
  decimal.mli
  dune
    (library
      (name decimal)
      (libraries str zarith))

Can anyone say what might be going wrong here?

Your issue is probably the lack of a (public_name ...) field in the library definition – this one catches me out from time to time too.

(edit: oops; I see in your edit that you already found a solution :upside_down_face:)

1 Like

Thanks in any case! Felt like this deserved to be marked as solved, so your answer was apropos!

It’s a known flaw in dune. If someone could upvote or fix it this would save many hours of debug for many many people: https://github.com/ocaml/dune/issues/2882

It’s on my endless TODO-list but i don’t have time to do it myself.

1 Like