Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
6.1.3, 6.3.0 Beta2
-
None
-
macOS 11
Intel CPU
Qt 6.1
Description
I'm running macdeployqt on a fairly large application, and it is failing when parsing the QML imports. I see the following in my application's build log:
ERROR: qmlimportscanner output error. Expected json array, got: ERROR: "" QProcess: Destroyed while process ("/Users/server/Qt/6.1.0/clang_64/bin/qmlimportscanner") is still running. [error] $QTDIR/bin/macdeployqt failed
When I run qmlimportscanner manually on the same QML files, it writes a correct output (valid non-empty JSON) to stdout.
Looking at the code for macdeployqt (in shared.cpp) I see that the qmlimportscanner output is being read in the following way:
// parse qmlimportscanner json
qmlImportScanner.setReadChannel(QProcess::StandardOutput);
QByteArray json = qmlImportScanner.readAll();
Because the process takes so long to run (due to the large number of QML files), the readAll() call occurs before any output is generated and an empty string is returned.
Modifying the code to the following appears to fix things for my case:
// parse qmlimportscanner json qmlImportScanner.setReadChannel(QProcess::StandardOutput); qmlImportScanner.waitForReadyRead(5 * 60 * 1000); //5 minutes QByteArray json = qmlImportScanner.readAll();