Project allways recompiles all sources(QtCreator + CMake)
-
Hello, this is my first question, so I apologize upfront for the mistakes I will certainly make.
The issue I'm having is that, starting from Qt 6.8.1, the slightest change in any file will ellicit an entire recompilation of my project. There are no errors issued. General Messages shows no warnings nor errors. I've tried erasing the build directory to no avail. Removing CMakeLists.txt.user also makes no difference. The cmake I'm using is the latest available at the Qt Maintenance Tool(but a previous version yielded the same result).
What's worse: Qt 6.9.0 triggers total recompilation just by hitting Run or Debug, without any change to the sources.
Tested with QtCreator 13,14,15, and 16.
Any version prior or equal to 6.8.0 works as its intented.
I don't know what I could include in the attachments to help.
Please, if someone have any insights as to what the problem might be, I would be very extremely grateful.
Thank you.
-
The build tool is the one that does all the work.
You can
ninja
to explain itself by going to Project Settings > Build Steps > Tool arguments and add-d explain
there.I have seen weird things when the Windows system time would be a bit out of sync and ninja would be confused. Rebooting Windows helped fix the issue.
-
@cristian-adam Thank you for your reply.
I did some tests with your suggestions. Rebooting changes nothing(also, I am using Linux by the way).
Having ninja explain itself yielded interesting results.When building against 6.8.0, it only reports: (TrainingPlanner is the name of the project)
ninja explain: recorded mtime of .qt/rcc/qrc_TrainingPlanner.cpp older than most recent input {path_to_last_modified_file}
ninja explain: TrainingPlanner is dirtyNow, when I use 6.8.1 and beyond it starts with
ninja explain: stored deps info out of date for 'CMakeFiles/TrainingPlanner.dir/TrainingPlanner_autogen/mocs_compilation.cpp.o' (1743783247875479231 vs 1743783585478830808)
ninja explain: recorded mtime of .qt/rcc/qrc_TrainingPlanner.cpp older than most recent input {path_to_last_modified_file}
ninja explain: TrainingPlanner is dirtyand then spews hundreds of lines in the form:
ninja explain: /include/c++/12/type_traits has no in-edge and is missing
ninja explain: /include/c++/12/type_traits is dirty
ninja explain: /include/x86_64-linux-gnu/c++/12/bits/c++config.h has no in-edge and is missing
ninja explain: /include/x86_64-linux-gnu/c++/12/bits/c++config.h is dirtyFor the the whole of c++ include paths.
Upon hitting Run without any modification to any of the source files, it doesn't say anything about the files in my project, writes the same things about the c++ includes and proceeds to recompile everything all over again.
So, there is certainly something that ninja does not agree with starting from Qt 6.8.1.
-
@GuilhermeF Can you please check the timestamps of the system include files ninja is complaining about?
ninja explain: /include/c++/12/type_traits has no in-edge and is missing ninja explain: /include/c++/12/type_traits is dirty ninja explain: /include/x86_64-linux-gnu/c++/12/bits/c++config.h has no in-edge and is missing ninja explain: /include/x86_64-linux-gnu/c++/12/bits/c++config.h is dirty
Is you system clock running correctly?
@elendilm you may perform the same checks on your system.
-
This post is deleted!
-
Hi, I was using KDE Neon with Ubuntu 20.04. Somehow my Qt Desktop 6.9 Kit was auto configured with clang which was clang10 in my system.
I updated to KDE Neon with Ubuntu 24.04. Now my Qt Desktop 6.9 Kit was auto configured with gcc (v13.3.0)
The problem was resolved after this.I haven't tested with clang to know if issue still persists. For now updated OS and gcc works.
-
can you try to replace Ninja with UnixMakefiles
kits->kits tab->CMake generator: Ninja on the right side click change button for replacement@JoeCFD Thank you for your reply.
Switching to UnixMakefiles or to Ninja Multi-Config resolves the problem at hand. Although both failed to compile the project due to a missing linker symbol.
-
@GuilhermeF Can you please check the timestamps of the system include files ninja is complaining about?
ninja explain: /include/c++/12/type_traits has no in-edge and is missing ninja explain: /include/c++/12/type_traits is dirty ninja explain: /include/x86_64-linux-gnu/c++/12/bits/c++config.h has no in-edge and is missing ninja explain: /include/x86_64-linux-gnu/c++/12/bits/c++config.h is dirty
Is you system clock running correctly?
@elendilm you may perform the same checks on your system.
@aha_1980 Thank you for your reply
The system clock is ok, The time stamps for all the files ninja complains are all older than the oldest file in my project tree. As I said in the original post, only with Qt versions 6.8.1 and newer I am having these issues.
-
@aha_1980 Thank you for your reply
The system clock is ok, The time stamps for all the files ninja complains are all older than the oldest file in my project tree. As I said in the original post, only with Qt versions 6.8.1 and newer I am having these issues.
@GuilhermeF said in Project allways recompiles all sources(QtCreator + CMake):
@aha_1980 Thank you for your reply
The system clock is ok, The time stamps for all the files ninja complains are all older than the oldest file in my project tree. As I said in the original post, only with Qt versions 6.8.1 and newer I am having these issues.
Sounds like a regression. Please do create a bug report for Qt.
-
@GuilhermeF said in Project allways recompiles all sources(QtCreator + CMake):
@aha_1980 Thank you for your reply
The system clock is ok, The time stamps for all the files ninja complains are all older than the oldest file in my project tree. As I said in the original post, only with Qt versions 6.8.1 and newer I am having these issues.
Sounds like a regression. Please do create a bug report for Qt.
@cristian-adam Thank you, I will.