ocamlocamlbuildomake

Error: The module List is an alias for module ListLabels, which is missing


Something is wrong with my build setup. I'm getting this error:

Error: The module List is an alias for module ListLabels, which is missing

In the interactive top-level ListLabels exists, but not during compilation.

I tracked this error message to this line of code in the OCaml compiler:

https://github.com/ocaml/ocaml/blob/70d880a41a82aae1ebd428fd38100e8467f8535a/typing/typetexp.ml#L905


Solution

  • Turns out the reason is the following compiler flag:

    -strict-deps  Hide .cmi whose name is not explicitly referenced