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

Semantics of module list properties in groups do not seem to be well-defined

    XMLWordPrintable

Details

    • 3925ddc6bfc99849836d427ba65e538370d2e047

    Description

      Consider a module m with these properties:

      property string stringProp: "string prototype"
      property stringList listProp: ["list prototype"]
      

      It could be used by some product like this:

      Product {
          // ...
          Depends { name: "m" }
          m.listProp: ["product", m.stringProp]
          Group {
              files: ["test.txt"]
          }
      }
      

      The value of m.listProp for both the product and the group is what we expect:

      ["product","string prototype","list prototype"]
      

      The first value comes verbatim from the product, the second value comes from the product (evaluated in the context of the module prototype), and the third one comes from the module prototype (remember that list properties are auto-concatenated among module instances).
      However, imagine that I now set one of the module properties in the group like this:

      m.stringProp: "group"
      

      My expectation as a user is that m.listProp in the group has the following value:

      ["product","group","list prototype"] // Expectation
      

      However, it is the following:

      ["product","string prototype","list prototype","list prototype"] // Reality
      

      Not only is the value we assigned to m.stringProp nowhere to be seen, but there is also an extra occurrence of the list prototype value.
      In fact, assigning any property of any module has the same effect; e.g. replacing the assignment of m.stringProp with one to qbs.buildVariant gives us exactly the same value for the list property.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kandeler Christian Kandeler
              kandeler Christian Kandeler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes