Open rgrinberg opened 4 years ago
Is it $pkg__private__helper
so it becomes bar__private__helper
and foo__private__helper
?
I believe it is your idea but just to precise:
-open Helper
-no-alias-deps
.I'm ok with it.
Is it $pkgprivatehelper so it becomes barprivatehelper and fooprivatehelper?
That's right. The package should guarantee uniqueness in this case.
It must go before the flags of the users. So they could do -open Helper
Good point.
We discussed the proposal during the meeting and accepted it.
This was supposed to be done as part of #3655, but since it turns out be a pretty large change, I decided to create a separate proposal for this.
Problem
Private libraries defined in different projects may collide. Consider these two private libraries defined in different dune projects:
and
While the two libraries can be installed, they cannot be used in the same library or executable.
Solution
Choose a compilation unit name that reflects that such private libraries are unique, and then use
-open
on libraries that users of such library to hide it. The scheme will look as follows:pkg__private__helper
will be the prefix for the compilation unit and the name of the lib interface module.pkg__private__helper__pub
with the following rename:helper
is used,-open Pkg__private__helper__pub
will be inserted.Note that this proposal will also require package private libraries to be
(wrapped true)
. I think that's a good idea regardless.I'd like to see what @bobot and @aalekseyev think about this.