Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-31416

Setting "Build before deploying" to "Build Only the Application to Be Run" has no effect for CMake projects

    XMLWordPrintable

Details

    • 54d9e8c4d (15.0)

    Description

      Something I've noticed working with qtdeclarative in Creator is that when I do something like an interactive rebase on a series of patches, hit Build > Build for Run Configuration "<the active auto test>", it will build with, say, 500 steps. So it's compiling a bunch of source files. Then I think that it must be finished so I hit Run. It then proceeds to perform 1500 more build steps involving source files.

      I always forget to capture the output before this happens, but here's a less egregious example. After Alt+B, R:

      14:43:09: Running steps for project QtDeclarative...
      14:43:09: Starting: "/usr/bin/cmake" --build /home/mitch/dev/qt-dev-debug/qtdeclarative --target tst_qquickrectangleshape
      [1/148 18.4/sec] Running syncqt.cpp for module: QtQuick
      [2/138 30.2/sec] Running syncqt.cpp for module: QtQuickTestUtils
      [3/137 45.0/sec] Running syncqt.cpp for module: QtQuickShapes
      [4/137 54.1/sec] Generating version linker script for target QuickShapesPrivate
      [5/137 0.5/sec] Automatic MOC for target Quick
      [6/137 0.6/sec] Running AUTOMOC file extraction for target Quick
      [7/137 0.7/sec] Running moc --collect-json for target Quick
      [8/136 0.4/sec] Building CXX object src/quick/CMakeFiles/Quick.dir/items/qquickitemanimation.cpp.o
      [9/136 0.5/sec] Building CXX object src/quick/CMakeFiles/Quick.dir/handlers/qquickhoverhandler.cpp.o
      [...]
      [93/136 1.8/sec] Building CXX object src/quick/CMakeFiles/Quick.dir/quick_qmltyperegistrations.cpp.o
      [94/136 1.5/sec] Linking CXX shared library /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6Quick.so.6.9.0
      [95/136 1.5/sec] Creating library symlink /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6Quick.so.6 /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6Quick.so
      [96/136 1.4/sec] Automatic MOC for target QuickShapesPrivate
      [97/136 1.4/sec] Running AUTOMOC file extraction for target QuickShapesPrivate
      [98/136 1.4/sec] Running moc --collect-json for target QuickShapesPrivate
      [99/136 1.4/sec] Automatic QML type registration for target QuickShapesPrivate
      [100/136 1.4/sec] Automatic MOC for target QuickTest
      [101/135 1.4/sec] Running AUTOMOC file extraction for target QuickTest
      [102/135 1.5/sec] Running moc --collect-json for target QuickTest
      [103/125 1.4/sec] Building CXX object src/quickshapes/CMakeFiles/QuickShapesPrivate.dir/quickshapesprivate_qmltyperegistrations.cpp.o
      [104/125 1.4/sec] Building CXX object src/quickshapes/CMakeFiles/QuickShapesPrivate.dir/QuickShapesPrivate_autogen/mocs_compilation.cpp.o
      [105/125 1.4/sec] Building CXX object src/quickshapes/CMakeFiles/QuickShapesPrivate.dir/qquickshapesoftwarerenderer.cpp.o
      [106/125 1.4/sec] Building CXX object src/quickshapes/CMakeFiles/QuickShapesPrivate.dir/qquickrectangleshape.cpp.o
      [107/125 1.4/sec] Building CXX object src/quickshapes/CMakeFiles/QuickShapesPrivate.dir/qquickshapegenericrenderer.cpp.o
      [108/125 1.5/sec] Building CXX object src/quickshapes/CMakeFiles/QuickShapesPrivate.dir/qquickshapecurverenderer.cpp.o
      [109/125 1.5/sec] Building CXX object src/quickshapes/CMakeFiles/QuickShapesPrivate.dir/qquickshape.cpp.o
      [110/125 1.5/sec] Building CXX object src/qmltest/CMakeFiles/QuickTest.dir/quicktest.cpp.o
      [111/125 1.5/sec] Linking CXX shared library /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6QuickShapes.so.6.9.0
      [112/125 1.5/sec] Creating library symlink /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6QuickShapes.so.6 /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6QuickShapes.so
      [113/125 1.5/sec] Linking CXX shared library /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6QuickTest.so.6.9.0
      [114/125 1.5/sec] Creating library symlink /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6QuickTest.so.6 /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6QuickTest.so
      [115/125 1.4/sec] Automatic MOC for target QuickTestUtilsPrivate
      [116/124 1.4/sec] Running AUTOMOC file extraction for target QuickTestUtilsPrivate
      [117/124 1.4/sec] Running moc --collect-json for target QuickTestUtilsPrivate
      [118/124 1.4/sec] Building CXX object src/quicktestutils/CMakeFiles/QuickTestUtilsPrivate.dir/quick/visualtestutils.cpp.o
      [119/124 1.4/sec] Building CXX object src/quicktestutils/CMakeFiles/QuickTestUtilsPrivate.dir/quick/viewtestutils.cpp.o
      [120/124 1.4/sec] Linking CXX static library /home/mitch/dev/qt-dev-debug/qtbase/lib/libQt6QuickTestUtils.a
      [121/124 1.3/sec] Automatic MOC for target tst_qquickrectangleshape
      [122/123 1.2/sec] Building CXX object tests/auto/quick/qquickrectangleshape/CMakeFiles/tst_qquickrectangleshape.dir/tst_qquickrectangleshape.cpp.o
      [123/123 1.2/sec] Linking CXX executable tests/auto/quick/qquickrectangleshape/tst_qquickrectangleshape
      14:44:50: The process "/usr/bin/cmake" exited normally.
      14:44:50: Elapsed time: 01:41.
      

      After Ctrl+R (after-ctrl-r.txt) is attached - apparently it's too big to paste.

      after-ctrl-r.txt

      If I do Ctrl+B first (ctrl-b-first.txt) followed by Ctrl+R (followed-by-ctrl-r.txt), it's roughly about the same amount of steps (334 vs 332).

      Why does it happen though? It would be nice if I could just get everything built at once rather than have to do it in two steps, because I end up doing other work while waiting for it to build (usually it takes much longer than the reproduced examples I used here) and end up wasting time because the "first" build has finished in the meantime.

      Eike said:

      The default setting for the Run action (actually deploy action) is "Build the Whole Project". Changable in Preferences > Build & Run > General > Build before deploying

      You can also assign a shortcut to Build > Run without Deployment or use the mnemonic for that (whatever that is? is there? I'm on macOS) and make a habit using that (I have Ctrl+Cmd+R set for that).

      I just tried that but didn't see any difference. Here are the steps I took:

      • Changed setting to "Build Only the Application to Be Run".
      • Rebased.
      • Alt+B, R.
      • Ctrl+R.
        Output from Ctrl+R:
        16:01:07: Running steps for project QtDeclarative...
        16:01:07: Starting: "/usr/bin/cmake" --build /home/mitch/dev/qt-dev-debug/qtdeclarative --target all
        [1/1036 78.9/sec] Running syncqt.cpp for module: QtQuickShapes
        [...]
        [224/224 2.7/sec] Linking CXX shared module /home/mitch/dev/qt-dev-debug/qtbase/qml/Qt/test/controls/libquickcontrolstestutilsprivateplugin.so
        16:02:32: The process "/usr/bin/cmake" exited normally.
        16:02:32: Elapsed time: 01:25.
        

      Eike said the support for this is missing for CMake:

      Attachments

        1. after-ctrl-r.txt
          26 kB
        2. ctrl-b-first.txt
          38 kB
        3. followed-by-ctrl-r.txt
          0.6 kB
        4. creator-source-screenshot.png
          creator-source-screenshot.png
          182 kB

        Issue Links

          For Gerrit Dashboard: QTCREATORBUG-31416
          # Subject Branch Project Status CR V

          Activity

            People

              cadam Cristian Adam
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes