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

Error: qmlcachegen inappropriately resolves file paths

    XMLWordPrintable

Details

    • All
    • f060664b0 (dev), fa59a8eb8 (6.9), 562639977 (6.8)

    Description

      Cannot invoke qmlcachegen for a file that has a symlink in its path:

      byuilddir$ qmlcachegen -o subprojects/qt-stuff/qml-meson.p/My_Mod_A.cpp --resource /home/mykola/Test/qmlbug/builddir/subprojects/qt-stuff/My_Mod_qml.qrc ../subprojects/qt-stuff/A.qml
      No resource path for file: ../subprojects/qt-stuff/A.qml

      It turns out, that paths for files in .qrc and for the input file of the command are resolved differently: with QDir::absoluteFilePath() and with QFileInfo::canonicalFilePath() correspondingly. The latter resolves symlinks in the path, while the former does not. This leads to different absolute paths and a failure to find qml in the .qrc

      I'd suggest replacing canonicalFilePath() with a plain absoluteFilePath() to preserve a directory structure expected by the user.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            iniato Mykola Dolhyi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes