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

Static Qt plugins not always linked into Qt apps in a top-level build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.2.1
    • Build System: CMake
    • None

    Description

      We currently have 2 mechanisms that handle linking of static plugins into executables.

      One is used in user projects and when building a Qt repo against already installed dependent Qt packages.
      Another when building Qt itself.

      The former uses usage requirements genexes, the latter collects linked libs at configure time.

      Unfortunately the libs collection is only done at qt_add_executable time (no deferred execution) which means it can miss libs added via qt_internal_extend_target.
      https://github.com/qt/qtbase/blob/46438c91f71249d89b17fd80ec0a00cd9166c63e/cmake/QtExecutableHelpers.cmake#L252
      If those libs expose static plugins, they would not be linked.

      This can be observed when building the qtdeclarative 'qml' app in a top-level static build.
      The qml target links to QtGui conditionally via qt_internal_extend_target and because of the above described limitation, no QPA (or any Gui) static plugins will be linked into the app, causing a runtime failure.

      This specific failure would not reproduce in a per-repo static build because usage requirements would be used to link the Gui plugins (first approach).

      We should check if we can fix the lib collection and plugin linking to be deferred.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-98058
          # Subject Branch Project Status CR V

          Activity

            People

              qtbuildsystem Qt Build System Team
              alexandru.croitor Alexandru Croitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes