Jbuilder (dune), odoc and libraries - incorrectly generated html

jbuilder

#1

I’ve started to create library documentation using jbuilder/odoc and hit a weird issue when I have a library ML file. Thus, given the following simple package:

A private module src/priv_module.ml:

(** Private module *)

(** Some private function doc *)
let privfun () = ()

The public module src/pub_module.ml:

(** Public module *)

(** Some public function doc *)
let pubfun () = ()

A library ML file to only export the public module, src/testlb.ml:

module Pub_module = Pub_module

And the following jbuild file:

(jbuild_version 1)

(library
 ((name testlib)
  (public_name testlib)
  ))

Compilation works fine but when I generate the documentation with jbuilder build @doc the testlib/Testlib/index.html file has links to testlib/Testlib/index.html#module-Pub_module and not the module documentation.

Changing src/testlib.ml to:

module Pub_module = Testlib__Pub_module

Fixes the issue but with larger libraries with multiple exported modules I get the following error during compilation:

Warning 49: no cmi file was found in path for module ...

for each of the exported modules. Is this me, odoc or jbuilder(dune)?

EDIT.
Using topkg doc gives the same results


#2

[replying to myself!]

At @trefis’s suggestion I upgraded to the git version of dune (jbuilder) which fixed this but adds a couple of other generated document tree problems. I have opened an odoc issue (ocaml/odoc#113) to track although this may still be an issue with dune (jbuilder) and related to ocaml/dune#651


#3

[Still talking to myself!]

This was a bug in dune (jbuilder) that has been resolved in dune beta20. Thanks to the dune team