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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 6.4.0 FF
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      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

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

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes