Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.7.0, 6.8.2
-
None
-
-
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.