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

Product.condition depending on module values might fail

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 1.10.1
    • Fix Version/s: 1.12.0
    • Labels:
      None

      Description

      The following project

      // modules/mybuildconfig/mybuildconfig.qbs
      Module {
          property bool falseProperty: false
      }
      
      // app.qbs
      Product {
          condition: mybuildconfig.falseProperty
          Depends { name: "does.not.exist" }
          Depends { name: "mybuildconfig" }
      }
      

      produces the error

      app.qbs:4 Can't find variable: mybuildconfig
      

      because mybuildconfig is indeed not loaded, because the module loader bails out as soon as does.not.exist cannot be loaded.

      Reordering the Depends items fixes the problem.

      // app.qbs
      Product {
          condition: mybuildconfig.falseProperty
          Depends { name: "mybuildconfig" }
          Depends { name: "does.not.exist" }
      }
      

      This is especially harmful in cases where inheritance is involved, because that makes it hard to control the order of Depends items.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              kandeler Christian Kandeler
              Reporter:
              jbornema Joerg Bornemann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes