-
Notifications
You must be signed in to change notification settings - Fork 411
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
should checkModule
in masonPublish
only count files?
#25064
Comments
I think you're absolutely right about the |
Thanks @benharsh for the reply! I think the fix itself (updating Suppose I have a library Option 1
This will be fine, Option 2
Do
I would understand from it that this structure should still be fine, since Option 3
This structure will currently fail (because of my diagnosis above) but based on my reading of the docs I think it should be accepted. Is there any problem with this? I tried a small toy example and |
I created a draft PR to fix this; however, it does allow Option 2 above, and I'm wondering whether that should be legal. I suspect that the second case could be a problem if Or if anyone happens to already know that Option 2 should be illegal that would be helpful. |
Looking at this some more, I think we should make Option 2 illegal, to avoid potential module-resolution ambiguities. This requirement can always be relaxed in the future if we decide it's too strict. |
…5084) Fix the bug in Mason's main-module check, outlined in [this issue](#25064), that prevents packages that use sub-modules from being accepted in the mason registry. [reviewed by @bmcdonald3 ] - thanks!
Currently
checkModule
doeshence
listDir
will count both files and directories, hence if my file has a structuresubModules
will be2
, leading the test to fail, despite it has only one submodule and one main module. Currently the function checks that thesrc
folder has only one child. Currently I think that test will only pass ifsrc
has exactly one file and no subdirectories.Moreover, I am a bit puzzled by the soundness of the check, the idea of the function is to check that the function has only one main module. Shouldn't the correct logic be something like
This would rely on the following assumptions
src
are considered main moduleswhich I believe is more in line with what described here and here.
on the other hand the documentation also says
so one could also use this logic in the check, although not sure if the compiler is aware of this.
The text was updated successfully, but these errors were encountered: