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

REG: Qt Quick Controls examples fail to run in static build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P1: Critical
    • None
    • 6.0.0 Alpha
    • None

    Description

      To test this, I built Qt dev with -static and -prefix /path/to/install. Then I tried compiling and running the gallery example in Qt Quick Controls 2, but when running it, it complains that "QtQuick" import is not found.

      Looking more closely at the build files, it seems that it has not generated any import for the QtQuick plugin. When investigating why, I found that the qmlimportscanner gets confused by some build artifacts in the current directory tree:

      This is the .json it outputs:

      [ [ { "name": "QtQuick", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick", "relativePath": "QtQuick", "type": "module" }, { "classname": "QtQuickControls2Plugin", "name": "QtQuick.Controls", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick/Controls", "plugin": "qtquickcontrols2plugin", "relativePath": "QtQuick/Controls", "type": "module" }, { "classname": "QtQuickControls2ImplPlugin", "name": "QtQuick.Controls.impl", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick/Controls/impl", "plugin": "qtquickcontrols2implplugin", "relativePath": "QtQuick/Controls/impl", "type": "module" }, { "classname": "QtQuickLayoutsPlugin", "name": "QtQuick.Layouts", "path": "/home/eskil/b2qt/2.5.3/sysroots/aarch64-poky-linux/home/eskil/dev/qt5-dev-b2q/install/qml/QtQuick/Layouts", "plugin": "qquicklayoutsplugin", "relativePath": "QtQuick/Layouts", "type": "module" }, { "classname": "QtQuickControls2MaterialStylePlugin", "name": "QtQuick.Controls.Material", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick/Controls/Material", "plugin": "qtquickcontrols2materialstyleplugin", "relativePath": "QtQuick/Controls/Material", "type": "module" }, { "classname": "QtQuickControls2DefaultStylePlugin", "name": "QtQuick.Controls.Default", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick/Controls/Default", "plugin": "qtquickcontrols2defaultstyleplugin", "relativePath": "QtQuick/Controls/Default", "type": "module" }, { "classname": "QmlSettingsPlugin", "name": "Qt.labs.settings", "path": "/home/eskil/b2qt/2.5.3/sysroots/aarch64-poky-linux/home/eskil/dev/qt5-dev-b2q/install/qml/Qt/labs/settings", "plugin": "qmlsettingsplugin", "relativePath": "Qt/labs/settings", "type": "module" }, { "name": ".", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/examples/quickcontrols2/gallery/gallery.qml", "type": "directory" } ], { "classname": "QtQuickControls2Plugin", "name": "QtQuick.Controls", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick/Controls", "plugin": "qtquickcontrols2plugin", "relativePath": "QtQuick/Controls", "type": "module" }, { "classname": "QtQuickControls2ImplPlugin", "name": "QtQuick.Controls.impl", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick/Controls/impl", "plugin": "qtquickcontrols2implplugin", "relativePath": "QtQuick/Controls/impl", "type": "module" }, { "classname": "QtQuickLayoutsPlugin", "name": "QtQuick.Layouts", "path": "/home/eskil/b2qt/2.5.3/sysroots/aarch64-poky-linux/home/eskil/dev/qt5-dev-b2q/install/qml/QtQuick/Layouts", "plugin": "qquicklayoutsplugin", "relativePath": "QtQuick/Layouts", "type": "module" }, { "classname": "QtQuickControls2MaterialStylePlugin", "name": "QtQuick.Controls.Material", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick/Controls/Material", "plugin": "qtquickcontrols2materialstyleplugin", "relativePath": "QtQuick/Controls/Material", "type": "module" }, { "classname": "QtQuickControls2DefaultStylePlugin", "name": "QtQuick.Controls.Default", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick/Controls/Default", "plugin": "qtquickcontrols2defaultstyleplugin", "relativePath": "QtQuick/Controls/Default", "type": "module" }, { "classname": "QmlSettingsPlugin", "name": "Qt.labs.settings", "path": "/home/eskil/b2qt/2.5.3/sysroots/aarch64-poky-linux/home/eskil/dev/qt5-dev-b2q/install/qml/Qt/labs/settings", "plugin": "qmlsettingsplugin", "relativePath": "Qt/labs/settings", "type": "module" }, { "name": ".", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/examples/quickcontrols2/gallery/gallery.qml", "type": "directory" } ]
      

      See the first entry:

      { "name": "QtQuick", "path": "/home/eskil/dev/qt5-dev-b2q/quickcontrols2/qml/QtQuick", "relativePath": "QtQuick", "type": "module" }
      

      For some reason, the QtQuick.Controls files have been installed into the source tree (in the root of the current repo) in addition to the install root. It looks like qmlimportscanner sees this and because it starts with QtQuick it expects the QtQuick plugin to be located there. Building examples outside the qtquickcontrols2 source tree does not exhibit this same problem.

      Note that this is with a qmake build, since static cmake builds do not work at all: QTBUG-86947

      Attachments

        Issue Links

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

          Activity

            People

              jbornema Joerg Bornemann
              esabraha Eskil Abrahamsen Blomfeldt
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes