-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #3727 #3729
Fix #3727 #3729
Conversation
Is it clear that we don't want to deprecate and eventually forbid using private names across packages? |
I'm also unsure about what's desirable here. Naively, I would expect private names to be hidden. (or the "private" terminology changed) |
Do you see a reason to do it? Private and public names can be used transparently in dune everywhere else.
For wrapped modules, private names allow you to set the toplevel module name. That doesn't always match the public name. |
I'd also like to clarify that private names are going to be visible when there's a
So it seems more consistent to allow it everywhere. |
Ok, sounds like "private" is just not a good name for this concept. Is it true that you have to use a private name to refer to the library in OCaml, or am I confused again? Whatever the answer, I have no objection to this change. (but I haven't read the code in detail) |
I'm using the term "private" by analogy to public. I don't think we actually refer to Yes the |
b61361b
to
c744a4e
Compare
By the way, this PR also fixes the issue in #3447. It seems like the PR is causes dune to segfault when running the test suite. That's quite strange. Investigating. In any case, @nojb or @aalekseyev I'd appreciate a review of the code. |
So, I have done a test locally:
Replacing the reference with And, presumably, we don't want to do that because it's slow to scan the entire library database? |
This isn't quite right. You're referring to a private name outside the scope where it's defined. That is expected to fail. You should however freely refer to |
Oh, I see my mistake. I assumed a package was a unit of scope isolation, but it's not: a project is. |
I thought this PR was pretty hard to understand, in part because very little is documented, and in part because it seems we're (ab-?)using a Do you think you can add clarifying comments and/or renamings that could explain why things are done this way? In particular, the change in gen_rules.ml looks like dark magic and needs a justification in a comment. Maybe |
@aalekseyev I've split the deprecation from the redirect stanza. Hopefully things are a little more clear now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked through the code and it looks good modulo a few comments.
Sorry for dragging my heels on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Allow it to work for non deprecated library names. Make it possible to alias private names as well Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
To fix this problem, I reuse the machinery in the deprecated library alias
stanza to inject a fake translation stanza for the private name. This is what
Jeremie recommended that I do.
The diff looks quite noisy and I'd appreciate some suggestions on how to
organize things a bit better here.