-
Suggestion
-
Resolution: Fixed
-
P3: Somewhat important
-
6.9.1
-
9de2e727d (dev), baa7daec8 (6.10), 3e07123c6 (6.9)
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.
For Gerrit Dashboard: QTBUG-138395 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
669509,2 | windeployqt: Add parameter to extend timeout of qmlimportscanner | tqtc/lts-6.8 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
663219,3 | windeployqt: Add parameter to extend timeout of qmlimportscanner | dev | qt/qtbase | Status: MERGED | +2 | 0 |
669416,2 | windeployqt: Add parameter to extend timeout of qmlimportscanner | 6.10 | qt/qtbase | Status: MERGED | +2 | 0 |
669454,2 | windeployqt: Add parameter to extend timeout of qmlimportscanner | 6.9 | qt/qtbase | Status: MERGED | +2 | 0 |