fix: directory module name checking#7601
Conversation
3f8011b to
5ed2981
Compare
anmonteiro
left a comment
There was a problem hiding this comment.
Could we mangle invalid names instead of erroring?
|
@anmonteiro If we mangle, how is the user supposed to refer to it in their file? Unless you are thinking of doing some name mangling with certain rules. It seems pretty complicated next to just renaming your source directory. I guess having a rule like |
|
I think it'd be beneficial to support some of those directories and document / log the mangling scheme. For melange specifically, we'll probably want to have directories called |
|
I suppose another solution would be to make the module name of a directory configurable from a stanza. So we could do That way when Dune wants to give module names corresponding to directories, it would query a naming map which would be overridden with these stanzas. That way you can name your directories whatever you want and not worry about name mangling. Another benefit of this is that it allows users to give a module name directly to say With such a feature, we would of course need to keep in mind the eventuality that OCaml adds namespaces, but I don't see that happening any time soon. |
|
I like a solution along those lines. We could even reuse |
|
(And it goes without saying: I don't think these should be implemented in this PR). The bug fix is sensible and looks good to me. |
|
@anmonteiro Can you open a ticket with this feature request then? |
5ed2981 to
b8ccca1
Compare
b8ccca1 to
f2cf2aa
Compare
Signed-off-by: Ali Caglayan <alizter@gmail.com>
Signed-off-by: Ali Caglayan <alizter@gmail.com>
f2cf2aa to
51e0205
Compare
|
I think the feature request in #7605 makes a lot of sense. I guess two other solutions to a directory with a malformed module name would be:
Should I open feature requests for those as well? |
I am not sure what exactly you mean here. Could you open an issue explaining this further?
You can use the |
|
cf #7620 for two examples. One is your suggestion for |
|
Feature request in question: #7628. |
|
@rgrinberg can this be merged? |
|
Yes |
fix #7600