Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-102162

Unnecessary rebuilding of targets when moc executable changes - on _next_ rebuild

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.0 FF
    • None
    • Linux/X11

    Description

      • Given an existing build of qtbase.
      • When modifying qbuffer.cpp.
      • Then a second ninja tst_qbuffer rebuilds all QtCore TUs that #include the moc file (= all)

      To reproduce:

      $ path/to/srcdir/configure ...
      $ ninja src/all
      $ ninja tst_qbuffer
      $ echo >> path/to/srcdir/src/corelib/io/qbuffer.cpp
      $ ninja tst_qbuffer
      (rebuilds qbuffer.o in bootstrap, re-links libbootstrap.a, moc, rebuilds qbuffer.o in QtCore, relinks Qt6Core, relinks tst_qbuffer)
      (as expected)
      $ echo >> path/to/srcdir/tests/auto/corelib/io/qbuffer/tst_qbuffer.cpp
      $ ninja tst_qbuffer
      (rebuilds all of QtCore's .o's)
      (expected: only rebuilds tst_qbuffer)
      

      I don't know whether this is a moc problem or an automoc one. In any case, I'd expect that the moc files are left unchanged if their re-writing would not change their content.

      Environment:

      • Ubuntu 20.04
      • cmake 3.21.1
      • local branch off of 344e0e7141667686a7e093aa76441bf2c43b6633
      $ cat config.opt
      -opensource
      -confirm-license
      -release
      -force-debug-info
      -separate-debug-info
      -c++std
      c++2a
      -developer-build
      -sctp
      -pch
      -sanitize
      address
      -sanitize
      undefined
      

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              mmutz Marc Mutz
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes