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

$$PWD returns the target path of NTFS symlink instead of the source one

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.9.0, 5.9
    • Build tools: qmake
    • None
    • Windows 10, Visual Studio 2017 - it doesn't really matter I guess...

       

    Description

      I am trying to build Qt 5.9 in C:\Qt which is actually a symlink to D:\Qt (no free space on C). Unfortunately it doesn't work well as at some point qmake discovers that c:\qt is actually d:\qt and starts mixing paths to both folders while performing initial configuration in configure.bat

      It finally comes to qtbase\configure.pri where the following two lines are at the top:

      QT_SOURCE_TREE = $$PWD
      QT_BUILD_TREE = $$shadowed($$PWD)

      Although I run configure.bat from disk C: and terminal shows path on disk C:, the first $$PWD returns the target path on disk D:. That's not a big deal, but at the second line $$shadowed() returned empty string as that path lies outside of the build tree.

      This consequently affects the generation of proper qt.conf file, as it is saved to 

      $$QT_BUILD_TREE/bin/qt.conf

      which in my case means c:\bin\qt.conf instead of the actual path like

      c:\qt\version\qtbase\bin\qt.conf

      To reproduce the issue simply create a symlink to another drive in Windows and try a simple pro-file like:

      message($$PWD)

      there. You'll get the target path instead of the current one. I believe we should get the current path instead.

      According to qmake sources, it finally comes to

      QFileInfo::canonicalFilePath()

      and I am not sure where it needs to be fixed - at qmake or Qt level.

      Also, it seems that we had something similar in the past: QTBUG-20431

      Attachments

        Issue Links

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

          Activity

            People

              buddenha Oswald Buddenhagen
              appsforlife Vitaly Ovchinnikov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes