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

Unnecessary dependency to Qt6QmlTools / qtdeclarative-native

XMLWordPrintable

    • Linux/Yocto
    • 94e474b48 (dev), b41b27352 (6.4), 0700f561b (6.5)

      This is an edge case detected by our customer in their internal tool meant for inspecting QML object hierarchies et al.  

      They are using Qt Quick C++ APIs but do not define a QML module using qt_add_qml_module in the CMakeLists.txt (nor does the project include any QML files) and this will cause a build error in Yocto:  

      | -- Could NOT find Qt6QmlTools (missing: Qt6QmlTools_DIR)
      | CMake Warning at /home/jajuntun/workdir/meta-boot2qt/build-apalis-imx6/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/qt6qmlnotfound/1.0-r0/recipe-sysroot-native/usr/share/cmake-3.24/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
      | Found package configuration file:
      | 
      | /home/jajuntun/workdir/meta-boot2qt/build-apalis-imx6/tmp/work/cortexa9t2hf-neon-imx-poky-linux-gnueabi/qt6qmlnotfound/1.0-r0/recipe-sysroot/usr/lib/cmake/Qt6Qml/Qt6QmlConfig.cmake
      | 
      | but it set Qt6Qml_FOUND to FALSE so package "Qt6Qml" is considered to be
      | NOT FOUND. Reason given by package:
      | 
      | Qt6Qml could not be found because dependency Qt6QmlTools could not be
      | found.

      This likely happens because of this old change: https://codereview.qt-project.org/c/qt/qtbase/+/260050

      The easy workaround is to add a qtdeclarative-native dependency to bitbake recipe: 
      DEPENDS += "qtbase qtdeclarative qtdeclarative-native"

      But this shouldn't be actually necessary since QML tools are not needed in this rare case and therefore this bug was created.

      I've added a simple example for reproducing the issue. I built it with dev branch of meta-boot2qt (https://code.qt.io/cgit/yocto/meta-boot2qt.git), using apalis-imx6 as target HW.

      I added the tarball and recipe under boot2qt-addons, but the location doesn't matter.

      ~/workdir/meta-boot2qt$ mkdir -p ./sources/meta-boot2qt/meta-boot2qt/recipes-qt/boot2qt-addons/files && cp ~/workdir/qt6qmlnotfound-1.0.tar.gz ./sources/meta-boot2qt/meta-boot2qt/recipes-qt/boot2qt-addons/files
      ~/workdir/meta-boot2qt$ cp ~/workdir/qt6qmlnotfound_1.0.bb ./sources/meta-boot2qt/meta-boot2qt/recipes-qt/boot2qt-addons/
      ~/workdir/meta-boot2qt$ export MACHINE=apalis-imx6
      ~/workdir/meta-boot2qt$ source setup-environment.sh
      ~/workdir/meta-boot2qt/build-apalis-imx6$ bitbake qt6qmlnotfound

       

        1. qt6qmlnotfound_1.0.bb
          0.5 kB
          Janne Juntunen
        2. qt6qmlnotfound-1.0.tar.gz
          0.9 kB
          Janne Juntunen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jbornema Joerg Bornemann
            jannej Janne Juntunen
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes