How Qt track dependencies in makefile?
-
Hello all.
I am trying to build Qt 5.12 on our CI. (it uses 40 parallel jobs to build) and sometimes I got build error:make[4]: *** No rule to make target '/home/jenkins/workspace/Products/Review/build/components/qt/qtbase/x86_64_kos/build/lib/libQt5DBus.a', needed by '../../../lib/libQt5ThemeSupport.a'. Stop. make[3]: *** [Makefile:157: sub-themes-make_first] Error 2 make[3]: *** Waiting for unfinished jobs.... make[2]: *** [Makefile:584: sub-platformsupport-make_first] Error 2 make[2]: *** Waiting for unfinished jobs.... make[1]: *** [Makefile:51: sub-src-make_first] Error 2
I think build system has race in generated Makefiles.
I am trying to understand, how does it work.I found that Qt build system generate Makefile per directory.
So we have
build/src/Makefile
build/src/dbus/Makefile
build/src/platformsupport/themes/Makefilein build/src/Makefile I see rule to build dbus module. it looks like
cd dbus && make -f Makefile
So we launch separate instance of make
the same "rules" we have for plaformsupport:cd platformsupport && make -f Makefile
and in file src/plaformsupport/Makefile
cd themes && make -f Makefile
The question. How this build system tracks dependencies, that dbus should be built BEFORE themesupport?
Now as I understand it is possible case:
- launch src/Makefile with 40 parallel jobs
- sub-platformsupport rule executed BEFORE sub-dbus rule
- in src/platformsupport/Makefile execute sub-themes rule
- in src/platformsupport/themes/Makefile we have rule:
../../../lib/libQt5ThemeSupport.a: /nvm/work/prod_analyzeqt2/build/components/qt/qtbase/x86_64_kos/build/lib/libQt5Gui.a /nvm/work/prod_analyzeqt2/build/components/qt/qtbase/x86_64_kos/build/lib/libQt5Core.a ...build/lib/libQt5DBus.a $(OBJECTS) $(OBJCOMP)
but libQt5DBus.a was not build yet. And THIS makefile does not know now to built it.
Am I right, or I miss something important?
-
@Vasily-Dybala It could also be that QDbus module was disabled.
You should check the configure log. -
Dbus in enabled in config.summary, also it has rules to build in src/Makefile, src/dbus/Makefile, and it built successfully in 95% cases on CI.
Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... yes Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes
If I disable Dbus, than makefile does not have dependenly:
lib/libQt5ThemeSupport.a: libQt5Dbus.a
But when Dbus is enable, we have a race.