Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-138395

Windeployqt: Add a switch to control timeout for qmlimportscanner

    XMLWordPrintable

Details

    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.

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            owolff Oliver Wolff
            miikapernu Miika Pernu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes