Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How Qt track dependencies in makefile?
QtWS25 Last Chance

How Qt track dependencies in makefile?

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
ci build
3 Posts 2 Posters 486 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vasily Dybala
    wrote on 17 Aug 2021, 08:00 last edited by
    #1

    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/Makefile

    in 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:

    1. launch src/Makefile with 40 parallel jobs
    2. sub-platformsupport rule executed BEFORE sub-dbus rule
    3. in src/platformsupport/Makefile execute sub-themes rule
    4. 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?

    J 1 Reply Last reply 17 Aug 2021, 08:25
    0
    • V Vasily Dybala
      17 Aug 2021, 08:00

      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/Makefile

      in 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:

      1. launch src/Makefile with 40 parallel jobs
      2. sub-platformsupport rule executed BEFORE sub-dbus rule
      3. in src/platformsupport/Makefile execute sub-themes rule
      4. 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?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 17 Aug 2021, 08:25 last edited by
      #2

      @Vasily-Dybala It could also be that QDbus module was disabled.
      You should check the configure log.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      V 1 Reply Last reply 17 Aug 2021, 09:46
      0
      • J jsulm
        17 Aug 2021, 08:25

        @Vasily-Dybala It could also be that QDbus module was disabled.
        You should check the configure log.

        V Offline
        V Offline
        Vasily Dybala
        wrote on 17 Aug 2021, 09:46 last edited by
        #3

        @jsulm

        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.

        1 Reply Last reply
        0

        2/3

        17 Aug 2021, 08:25

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved