Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
2.1.0, 2.2.0, 2.1.1, 2.1.2, 2.2.1
-
None
-
-
0592a8709 (2.2)
Description
Consider dependencies which look like:
Application { consoleApplication: true files : [ "main.cpp" ] Depends { name: "cpp" } Depends { name: "Qbs.Labs.Settings" } Depends { name: "Qbs.Controls.Material.Impl" } }
In such scenario Qbs will produce following error message:
The name of module 'Qbs.Controls.Material.Impl' is equal to the first component of the name of module 'Qbs.Labs.Settings', which is not allowed
This error message is confusing at least. When you change the dependencies to something like:
Depends { name: "Qbs.Labs.Settings" } Depends { name: "Qbs.Controls.Material" }
the error disappears. I'm not sure what is the rationale behind this check, but to me current behavior looks suspicious and incorrect.
I've investigated source code a bit and it seems the method DependenciesResolver::checkForModuleNamePrefixCollision() compares the list sizes and first elements only. I may be wrong, but I believe the intent was to eliminate dependencies such as Qbs.Controls and Qbs.Controls.Material (still not sure why we need this though). When full module name isn't a part of the other module prefix Qbs shouldn't produce an error IMO. Thus I believe that for example Qbs.Controls.Impl and Qbs.Controls.Material.Impl should be allowed, because full module name of the first dependency isn't a part of the other dependency prefix.
This new behavior destroyed my projects, because I've used to name products following directly QML module naming convention and such consistency paid back, so I hope we can bring back the old behavior.
Attaching MRE to play with.
Attachments
For Gerrit Dashboard: QBS-1772 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
530096,3 | DependenciesResolver: Fix module name prefix collision check | 2.2 | qbs/qbs | Status: MERGED | +2 | -1 |