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

When running macdeployqt: qmlimportscanner output error. Expected json array, got: ""

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.1.3, 6.3.0 Beta2
    • QML: Tooling
    • None
    • macOS 11
      Intel CPU
      Qt 6.1
    • macOS

    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();

       

       

      Attachments

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

        Activity

          People

            fawzi Fawzi Mohamed
            nedelman Derek Nedelman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes