build.xml error : 2 modules with the same name


I am trying to build a custom IDE, I generated the build.xml using the wizard. It is giving me a strange error, one of my languages is apparently the cause of it. The error message says :

Error: There are two modules visible from the project [MyProject] with the same name "FeatureModel"

The error goes on saying how both modules are from the same model in my file.

I went and checked that file, and upon search, "FeatureModel" returns 7 matches, 6 of which appear in the same node (concept="1E1JtD", role="2G$12L") which I assume is the type of nodes that contain my modules since there's the exact number of those nodes (4 in this case) and they contain the names of my other modules. The other match appeared after I fixed an error with one of my other languages' dependencies by using the "Reload modules from disk" intention, and in the same node is contained the name of another language that is also a dependecy so it is definitely not causing the error.

I also searched for the uuid of my language, which only appeared once.

Now, this language used to be called differently and also used to contain a lot more concepts, and when I first inspected it I found a bunch of folders with the old name containing the old files which I had forgotten to delete. I have deleted those folders since then, to no avail.

I have tried generating a MPS plugin instead, but the same error appeared, and I have made sure that MPS was up to date, which it is. I have no idea what is causing this issue or how to fix it.

Thanks in advance for taking the time to help me with this error.

Comment actions Permalink

What dependencies does your build script have in the corresponding section? Can you post a screenshot of the build script?

Comment actions Permalink

Here is a screenshot of the dependencies section :

Here is also a screenshot showing the group section :

As expected, I can replicate this error with my other languages by trying to add Strategy twice, for example.

I really don't see what might be causing this. Here is a screenshot of the unfolded FeatureModel :

And the one from Strategy, which imports FeatureModel :

Comment actions Permalink

I have continued to investigate this error. I have found out that the /.mps/workspace.xml file uses the old name for absolutely all of the beforePath nodes corresponding to FeatureModel, for example :

<change beforePath="$PROJECT_DIR$/languages/FeatureModel/classes_gen/Methodology/Language.class" beforeDir="false" />

It shouldn't be Methodology anymore, since I renamed the language module. As I stated earlier, I found these old folders still there, alongside the new ones bearing the proper new name, and have since deleted those old folders.

The strangest part is, I tried deleting the file and regenarating it by restarting MPS and the new workspace.xml still had the same problem. I even tried manually modifying the file to make sure the paths pointed to a folder that exists and it still updated it back to that when I restarted MPS to see if the change had an effect.

I have no idea if it is responsible for the error I'm getting, but it is definitely strange.

Another thing I have tried is to see what happens when I moved the /languages/FeatureModel folder out of the project and restarted MPS. Unsurprisingly, it game me a new error saying the module didn't exist, but the other error was still there, so I don't think it has anything to do with what's inside the /languages/FeatureModel folder.

The error specifically states that the problem comes from the file, which I inspected again but still found nothing suspicious inside of. Here's a screenshot of the section about the FeatureModel language:

Comment actions Permalink

I found it!

I had to force the reload through the pre-generate validation to find out where the error was. For whatever reason, my FeatureModel language's generator was not called FeatureModel.generator like the other languages would, but FeatureModel, which is what caused the 2 modules with the same name to happen.

I just deleted the generator, made a new one and made a new build script with the wizard. Error gone!


Please sign in to leave a comment.