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

Command line module overrides not available when loading modules

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 2.6.0
    • None

    Description

      I have a project with a custom modules in different flavors for different target platforms

       // modules/buildconfig/BaseModule.qbs
      Module {
          condition: false // not to be used
          property string platform
      }
      
      // modules/buildconfig/platform1.qbs
      BaseModule {
          condition: {
              console.warn("Platform: " + platform) // debug print
              return  platform === "platform1"
          }
      }

      The actual platform is selected from command line as an override:

       modules.buildconfig:platform1

      It looks like the override is applied only very late in the process, but not when resolving module candidates. platform is always "undefined" in above scenario except for the final resolver pass. But that is too late. Qbs aborts with "Dependency "buildconfig" not found for product "xxx".

      Only when I change the condition to:

       platform === undefined || platform === "platform1"

      the module is found. But that won't work with multiple module candidates.

      The behavior is unexpected. Module overrides from command line should always be taken into account, just like profile settings.

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes