Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
6.3.2
-
Visual Studio 16 2019
Description
QML linting target is not functional at least on Windows with Visual Studio 16 2019 generator for a project with a huge number of QML files (over 600 in my case)
An executable target is used as backing target for a QML module, i.e.:
... qt_add_executable(my_project WIN32) ... qt_add_qml_module(my_project URI MyProject VERSION 1.0 QML_FILES Resources/QML/component1.qml Resources/QML/component2.qml ... Resources/QML/component600.qml # <--- more than 600 QML files NO_RESOURCE_TARGET_PATH )
As result additional target my_project_qmllint is generated with custom build rule that looks like this:
setlocal cd D:\my_project if %errorlevel% neq 0 goto :cmEnd D: if %errorlevel% neq 0 goto :cmEnd e:\Qt\6.3.2\msvc2019_64\bin\qmllint.exe -I D:/my_project_build --resource D:/my_project_build/.rcc/qmake_MyProject.qrc --resource D:/my_project_build/.rcc/qmake_MyProject_copy.qrc --resource D:/my_project_build/.rcc/my_project_raw_qml_0.qrc D:/my_project/Resources/QML/component1.qml D:/my_project/Resources/QML/component2.qml ... D:/my_project/Resources/QML/component600.qml if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone :cmErrorLevel exit /b %1 :cmDone if %errorlevel% neq 0 goto :VCEnd
The problem is that this command can't be executed at all because of Maximum Command Line Length Limitation (see https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation, https://stackoverflow.com/questions/3205027/maximum-length-of-command-line-string). In my case, the total length of the command significantly exceeds this limit (it's more than 46k characters).
I see the next possible solutions:
1. generate and use a file with a list of qml sources as an input for qmllint tool (don't know for what the "--resource" option is used here and why it doesn't read qml sources directly from listed qrc files)
2. apply custom build rule on each qml source file individually, e.g. as qmlcachegen does.
3. something else...
Attachments
Issue Links
- duplicates
-
QTBUG-119675 [qmllint ] Enabling the qmllint for a lot of QML files exceeds the command line limitation on Windows host
- Closed
- relates to
-
QTBUG-106683 qt_add_qml_module: _automoc_json_extraction target and resources are rebuilding every time with Visual Studio Generator
- Closed