Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.4.0 FF
-
None
Description
I bumped into this problem in QtPositioning.
QtPositioning completely relies on plugins, because they provide various positioning backends. The module is simply non-functional without them. For the purpose of testing the module has several test plugins that are located directly in the tests build tree.
According to the documentation, for static builds we need to use
- qt_import_plugins()
- qt_import_qml_plugins()
to explicitly specify that this application/test need to link to specific plugins.
However using them reveals some problems.
In-tree build
For the in-tree build I used the following config:
<path to qt5>/configure -debug -developer-build -static -nomake examples -submodules qtbase,qtdeclarative,qtserialport,qtpositioning -- -DQT_BUILD_TESTS_BY_DEFAULT=OFF
it is documented that qt_import_qml_plugins() calls qmlimportscanner to determine which plugins we actually need to import and link. But in the in-tree build qmlimportscanner is not yet built by the time we want to use it. This results in the following error:
CMake Error at qt6-build/static_build/qtbase/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:2492 (message): The package "QmlImportScanner" references the file "tool_path-NOTFOUND" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty. Call Stack (most recent call first): qt6-build/static_build/qtbase/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:2638 (_qt_internal_scan_qml_imports) qt6-build/static_build/qtbase/lib/cmake/Qt6Qml/Qt6QmlMacros.cmake:2710 (qt6_import_qml_plugins) qtpositioning/tests/auto/declarative_positioning_core/CMakeLists.txt:44 (qt_import_qml_plugins)
Out-of-tree build
For out-of-tree build I used the following config:
<path to qt5>/configure -debug -developer-build -static -nomake examples -nomake tests -submodules qtbase,qtdeclarative,qtserialport,qtpositioning
and after that built the tests in a separate directory using
<path to static built qtbase>/libexec/qt-internal-configure-tests /path/to/qtpositioning
The issue here is that the plugins to be imported are taken from the installation dir, but the custom test plugins are simply not yet installed at the time of configuring. So we will never find and link them.
So for now it looks like in the static configuration there is no way to build tests for the modules that use custom test-specific plugins.
This problem currently affects at least QtPositioning and QtLocation.
Attachments
Issue Links
- blocks
-
QTBUG-104448 Fix QtPositioning tests for static builds
- Open
- is duplicated by
-
QTBUG-93625 qt_internal_add_test doesn't call qt_import_qml_plugins
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-104465 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
417281,4 | Disable some tests in static builds | dev | qt/qtpositioning | Status: MERGED | +2 | 0 |
418565,2 | Disable some tests in static builds | 6.4 | qt/qtpositioning | Status: MERGED | +2 | 0 |
418566,2 | Disable some tests in static builds | 6.3 | qt/qtpositioning | Status: MERGED | +2 | 0 |
418573,3 | Disable some tests in static builds | tqtc/lts-6.2 | qt/tqtc-qtpositioning | Status: MERGED | +2 | 0 |