Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
Qt Creator 15.0.0
-
None
-
Windows 11 24H2
QtCreator 15.0.0
MSVC 2019
Description
Hello, I just updated to QtCreator 15.0.0 and I have some new/old freezes re-occuring more often while compiling.
I am compiling a large CMake project with up to 5000 files, including both C++ and QML.
Once the project is fully compiled, if I edit a C++ file (from the backend), it recompiles in a few seconds with no freeze. But as soon as I edit a QML file or a C++ file used in a QML plugin, QtCreator starts to compile and then suddenly freezes, between between 10s and more than one minute.
The last line that I get in the console right before the freeze seems always related to QML plugins. For example:
- [6/22 0.6/sec] Building CXX object gui\XXX\plugin\CMakeFiles\XXXplugin_resources_3.dir\.rcc\qrc_XXXplugin_raw_qml_1.cpp.obj
- [12/29 0.6/sec] Linking CXX static library bin\plugins\XXX\XXXplugin.lib
I also did a few memory dumps during the freeze, and they all relate again to QtCreator iterating over thousands of files on the disk, through the QFileSystemWatcher:
This issue is not new in itself, I have it in different scenarios since ~2020 or 2021:
- It used to happen at every compilation, freezing from the beginning: It has been fixed.
- Then it happened at every compilation where the CMake was re-executed automatically on the fly (e.g. if edited inbetween): This is still open, but fortunately quite rate (workaround is to re-run CMake before compiling)
- Now it seems to happen again at each compilation when some QML plugins are involved. It's too early for me to be able to describe the exact domain where it freezes or not.
- On one of my computers, there is another freeze/lag (since 2021), around 10-20s each time QtCreator regains focus after doing something on another window. I'm not 100% sure if it is related but it looks like it. I could do one dump so far and it was also iterating over directories.
Related issue: https://bugreports.qt.io/browse/QTCREATORBUG-28957
We are using qt_add_qml_module() to create the QML plugins in CMake. I don't know if there is something special in our project that could trigger this freeze. But out of nowhere, I would suspect something like the output path or bin path ending up being checked for modifications with QFileSystemWatcher, causing a full re-listing of all directories each time a single output file is created by the compiler; or something like that.
For example, we use GenerateExportHeader in CMake and we generate theses export headers in the CMAKE_CURRENT_BINARY_DIR folder, and then we add it to the include directories of the target so that it can be found.
Any help would be appreciated.