Uploaded image for project: 'Qbs ("Cubes")'
  1. Qbs ("Cubes")
  2. QBS-1772

Confusing module name collision check

    XMLWordPrintable

Details

    • All
    • 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

        Activity

          People

            kandeler Christian Kandeler
            qdoc Michal Policht
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes