Closed avsm closed 3 years ago
It's essentially a historical artefact that we're slowly homogenising. There are three classes of names:
dune
uses the (name)
field as the toplevel wrapped module name by default, so it restricts libraries to valid OCaml module names by default.public_name
gives the whole package a name, which can be used to separate files at the opam level (and this can contain multiple findlib archives). The easy (but I agree unintuitive) fix is to simply name the archive (name)
with underscores, and the public name
with dashes. https://github.com/ocaml/dune/issues/4783 also suggests a better error hint in this case.Unfortunately, all three namespaces are used in various existing systems (consider findlib subpackages for example), so the migration itself is an ongoing process. The defaults in dune shove users towards matching findlib and opam names, so that opam install <pkg>
is also what the user would type into (library <pkg>)
to depend on it. (thanks @jeremiedimino for clarifying some of this for me)
Committing the generated opam file will also let
opam pin add
work for the development repository (with--dev
)