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

Unnecessary re-builds triggered when source or build dir are symlinked

    XMLWordPrintable

Details

    • User Story
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • None
    • Build System: CMake
    • None

    Description

      I followed instructions from qtbase/cmake/README.md to build developer build:

      cmake -GNinja -DFEATURE_developer_build=ON {path to source directory}
      cmake --build .
      

      Once build has finished, If I retype "cmake --build ." It again does something with 2000+ files. When that finished, if I type "ninja", it again does something with 3000+ files.

      Moving source and build dir to paths that do not contain symlinks, solved the issue.

      I observed this on Ubuntu 20.04 (freshly installed system, with cmake version 3.19.1) and Ubuntu 18.04, which has seen a better days.

      I suggest to bail out with an error message if symlinks are detected in the paths. To support paths with symlinks would require adding an extra setup in CI, otherwise this would always regress. In other cmake projects I have noticed that we need to be careful how we access paths in cmake commands - get_filename_component(.. REALPATH) seem to be important.

      Also moc has some issues with handling symlinked paths. The issue could be reproduced reliably at some point in my project, but at some point it "resolved" itself, probably as random side-effect.

      Attachments

        For Gerrit Dashboard: QTBUG-89559
        # Subject Branch Project Status CR V

        Activity

          People

            jbornema Joerg Bornemann
            paeglis Gatis Paeglis
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes