Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-18360

Projects with CMake do not handle build directories with symlinks properly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • Qt Creator 4.3.0

    Description

      If I create a new CMake project using the new project wizard and use a symlink in my project directory then the the resulting CMake files have a mix of symlinks and canonical paths and the Remote Directory in the Run Settings is not calculated correctly. Instead of using only the path given in the QtCreatorDeployment.txt file it has that path with the relative path between the symlink and canonical path appended.   Since the Remote Directory is not an editable field it becomes impossible to deploy the executable to the target.

      This behavior also occurs if instead of creating a new cmake project I open an existing CMakeLists.txt that has not been used in QtCreator before.

      The very non-obvious work around is to change the build directory in Build Settings to use the canonical path instead of the symlink path. The only way we found the issue was examining the QtCreator source code-this line of code is where the issue is apparent:

      https://github.com/qtproject/qt-creator/blob/6e8ee7479e7fda2c79c50f1ffea5d7bda36f96d0/src/plugins/cmakeprojectmanager/cmakeproject.cpp#L499

      It appears that the relativeFilePath method on that line does not calculate the relative path correctly  if the build dir uses a symlink and executable path does not, which is what appears to have happened in this case.

      Attachments

        1. RunSettings.png
          RunSettings.png
          63 kB
        2. RemoteDirectory.png
          RemoteDirectory.png
          16 kB
        3. QtCreatorDeployment.txt.png
          QtCreatorDeployment.txt.png
          19 kB
        4. BuildSettings.png
          BuildSettings.png
          111 kB

        Issue Links

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

          Activity

            People

              cadam Cristian Adam
              jasonbeach Jason Beach
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes