dune icon indicating copy to clipboard operation
dune copied to clipboard

Suggest specifying package as a solution to a public library depending on a private library

Open polytypic opened this issue 11 months ago • 2 comments

Currently, if I have a private library (that doesn't have a public name), and a public library that depends on it, dune gives this error:

Error: Library "private" is private, it cannot be a dependency of a public library. You need to give "private" a public name.

I would love to see this changed to something like:

Error: Library "private" is private, it cannot be a dependency of a public library. You need to give "private" a public name or specify a package for it.

This is a feature I personally learned about just today. I wish I had known this earlier, because I've used more involved workarounds earlier.

polytypic avatar Mar 07 '24 13:03 polytypic

How about adding a "hint" with your suggested text as the message to this error?

rgrinberg avatar Mar 07 '24 16:03 rgrinberg

Any formulation of the message that helps people discover that public libraries may actually depend on private libraries if you just specify the package for those private libraries is fine with me.

polytypic avatar Mar 07 '24 16:03 polytypic