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

qbs fails to build two configurations simultaneously when a Qt dependency is used

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 1.12.2
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      macOS, Windows

      Description

      Quick summary:

      • The problem only shows up if the Qt dependency is there. If there is only a cpp dependency the problem cannot be reproduced.
      • The problem only shows up if the build dir is empty and you try to build two configurations
      • If there is already one configuration in the build folder the problem only shows up when the first config specified in the command line is the one that does not yet exist

      Assume there is a valid qt setup of qbs named, e.g. "qt597".
      Also given is the following simple qbs project:

      — qbs-test.qbs

      import qbs
      CppApplication {
        Depends{ name: "Qt.core" }
        targetName: qbs.buildVariant === "debug" ? "test_debug" : "test"
        files: ["main.cpp"]
      }
      

      — main.cpp

      int main( int, char** )
      {
          return 0;
      }
      

      Now

      • open a command prompt and cd into the project folder
      • run qbs in the following ways (beware build-directory usage, it is not required but makes clean up easier between test cases)

      (1) single-debug

      Make sure the test folder is gone or empty.

      > qbs config:debug profile:qt597 --build-directory ./test

      OK: debug build inside ./test/debug

      (2) single-release

      Make sure the test folder is gone or empty.

      > qbs config:release profile:qt597 --build-directory ./test

      OK: release build inside ./test/release

      (3) debug and release

      *Make sure the test folder is gone or empty.*

      > qbs config:debug config:release profile:qt597 --build-directory ./test

      FAIL: only release folder inside test that only contains release.bg
      output:

      Build graph does not yet exist for configuration 'release'. Starting from scratch.
      Resolving project for configuration release
      Build graph does not yet exist for configuration 'debug'. Starting from scratch.
      Resolving project for configuration debug
      ERROR: .../qbs-test/qbs-test.qbs:3:1 Error while handling product 'qbs-test':
       .../qbs-test/qbs-test.qbs:4:2 Dependency 'Qt.core' not found for product 'qbs-test'.
      Please create a Qt profile using the qbs-setup-qt tool if you haven't already done so.
      Setting up build graph for configuration release
      ERROR: Execution canceled.

      NOTE: if you exchange config:debug and config:release test contains debug instead.

      (4) first single, then both

      NOTE: for this test case it's not important if the first build is debug or release unless it's a single config:xxx parameter

      *Make sure the test folder is gone or empty.*

      > qbs config:debug profile:qt597 --build-directory ./test

      OK: debug build inside ./test/debug

      > qbs config:debug config:release profile:qt597 --build-directory ./test

      OK!!!: debug and release build in ./test

      BUT if you would execute

      > qbs config:release config:debug profile:qt597 --build-directory ./test

      instead, you would get the same error as above.

      So first debug, then debug release works, but first release then debug release does not work (always start with empty build dir)

      (5)

      When i specify the profile first, it just works:

      > qbs profile:qt597 config:debug config:release --build-directory test

      OK: debug and release build in ./test

        Attachments

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

          Activity

            People

            Assignee:
            kandeler Christian Kandeler
            Reporter:
            hrabowski Maximilian Hrabowski
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes