Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.9.1
Description
Suggestion:
Add a switch to windeployqt to control qmlimportscanner timeout.
Document the possibility of a timeout and explain workarounds.
Improve logging from windeployqt (=> explain the root cause of the timeout, offer solutions).
A switch to skip scanning certain directories would help too.
Background:
Current implementation of windeployqt can cause qmlimportscanner to timeout.
It looks like the current implementation of windeployqt uses QProcess to run qmlimportscanner like so:
QProcess process; process.setProgram(binary); process.setArguments(args); process.setWorkingDirectory(workingDirectory); // Output the command if requested. if (optVerboseLevel > 1) { QString commandLine; appendToCommandLine(binary, &commandLine); for (const QString &a : args) appendToCommandLine(a, &commandLine); std::wcout << "Running: " << commandLine << '\n'; } process.start(); if (!process.waitForStarted() || !process.waitForFinished()) { if (errorMessage) *errorMessage = process.errorString(); return false; }
and it calls "waitForFinished" for the qmlimportscanner process. QProcess::waitForFinished has a 30 second timeout by default which is probably more than enough for 95% of projects, however, if the project is either huge or the project directory happens to contain e.g. build artifacts, qmlimportscanner may require more than 30 seconds to run in which case a timeout occurs and deployment fails.
It should be noted that Qt Creator creates the build directory within the source directory by default. So, if a user uses Qt Creator with default settings to build and then deploys while passing source root as --qmldir, it is very likely that qmlimportscanner ends up scanning unnecessary stuff and the chances for a timeout occurring significantly increase.