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

CMake configuration breaks if configuring while building and vice versa

    XMLWordPrintable

Details

    • 32c389a55 (12.0)

    Description

      To reproduce do the following with a CMake project and on Windows:

      1. open a CMake project configured to use the Ninja generator
      2. edit CMakeLists.txt
      3. save CMakeLists.txt
      4. wait for reconfigure step starting
      5. start a proper build

      With a high probability the build will also try to reconfigure the project. During the concurrent CMake runs both processes might try to modify the same files, resulting in errors like this:

      [cmake] CMake Error:
      [cmake]   Running
      [cmake] 
      [cmake]    'C:/Qt/Tools/Ninja/ninja.exe' '-C' 'C:/Users/Mathias/Builds/qtcsg-Desktop_Qt_6_5_2_MinGW_64_bit_mingw64-Debug' '-t' 'recompact'
      [cmake] 
      [cmake]   failed with:
      [cmake] 
      [cmake]    ninja: error: failed recompaction: Permission denied
      [cmake] 
      [cmake] 
      [cmake] 
      [cmake] CMake Error:
      [cmake]   Running
      [cmake] 
      [cmake]    'C:/Qt/Tools/Ninja/ninja.exe' '-C' 'C:/Users/Mathias/Builds/qtcsg-Desktop_Qt_6_5_2_MinGW_64_bit_mingw64-Debug' '-t' 'restat' 'build.ninja'
      [cmake] 
      [cmake]   failed with:
      [cmake] 
      [cmake]    ninja: error: failed recompaction: Permission denied
      [cmake] 
      [cmake] 
      [cmake] 
      [cmake] CMake Generate step failed.  Build files cannot be regenerated correctly.
      

      As a result the configuration is broken, and it's not possible anymore to build the project or to get automatic reconfigures while saving the CMakeLists.txt.

      Do repair the situation one has to wait until both the automatic reconfiguration and the build have finished. After that the project can be restored by running CMake from project explorer.

      While the situation is easy to restore and avoid, it gets into the way way too often. Maybe QtCreator can be fixed to wait with the reconfigure or build step, until the other has finished. This should fix the problem.

      Attachments

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

        Activity

          People

            cadam Cristian Adam
            hasselmm Mathias Hasselmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes