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

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

我的构建设置出了点问题。我收到此错误:

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

在交互顶层ListLabels存在,但在编译期间不存在。

我在 OCaml 编译器中将此错误消息跟踪到这行代码:

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

原来原因是以下编译器标志:

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