Bug 459337 - Some tests fail when built statically
Summary: Some tests fail when built statically
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kconfig
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.68.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-18 16:33 UTC by Dawid Wróbel
Modified: 2022-10-18 10:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dawid Wróbel 2022-09-18 16:33:58 UTC
SUMMARY

See the pipeline run for a complete log:
https://invent.kde.org/frameworks/kconfig/-/jobs/484432
Comment 1 Dawid Wróbel 2022-09-20 12:27:15 UTC
The error reported is:

QWARN  : KConfigTest::initTestCase() kf.config.core: KConfigGroup::writeEntry was passed GUI type ' QColor ' but KConfigGui isn't linked! If it is linked to your program, this is a platform bug. Please inform the KDE developers
QWARN  : KConfigTest::initTestCase() kf.config.core: KConfigGroup::writeEntry was passed GUI type ' QColor ' but KConfigGui isn't linked! If it is linked to your program, this is a platform bug. Please inform the KDE developers
QWARN  : KConfigTest::initTestCase() kf.config.core: KConfigGroup::writeEntry was passed GUI type ' QFont ' but KConfigGui isn't linked! If it is linked to your program, this is a platform bug. Please inform the KDE developers
PASS   : KConfigTest::initTestCase()
QWARN  : KConfigTest::testComplex() kf.config.core: KConfigGroup::readEntry was passed GUI type ' QColor ' but KConfigGui isn't linked! If it is linked to your program, this is a platform bug. Please inform the KDE developers
QWARN  : KConfigTest::testComplex() kf.config.core: unhandled type  QColor
FAIL!  : KConfigTest::testComplex() Compared values are not the same
   Actual   (QVariant(sc3.readEntry("colorEntry1", QColor(Qt::black))).toString()): "#000000"
   Expected (QVariant(s_color_entry1).toString())                                 : "#4682b4"
   Loc: [/builds/frameworks/kconfig/autotests/kconfigguitest.cpp(80)]


The important bits are:
kf.config.core: KConfigGroup::writeEntry was passed GUI type ' QColor '/'QFont'
kf.config.core: unhandled type  QColor/QFont
Comment 2 Volker Krause 2022-09-24 15:25:21 UTC
This is due to `initKConfigGroupGui()` in kconfiggroupgui.cpp not being called when building statically, forcing that by manually calling it from the test fixes it.
Comment 3 Volker Krause 2022-09-25 10:13:51 UTC
I'm not finding a way to do this without explicit API, not even with just one compiler, let alone portable.
Comment 4 Bug Janitor Service 2022-10-17 16:05:07 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfig/-/merge_requests/145
Comment 5 Alexander Lohnau 2022-10-18 10:42:29 UTC
Git commit d6173cee8d62b241672d98abe9dd6515d2049336 by Alexander Lohnau.
Committed on 17/10/2022 at 16:02.
Pushed by alex into branch 'master'.

Fix KConfigGui initialization in case of static builds

This way we ensure that the symbols land in the actual executable and
thus we call the KConfigGui method.

M  +8    -0    src/gui/CMakeLists.txt
M  +2    -1    src/gui/kconfiggroupgui.cpp
A  +6    -0    src/gui/kconfigguistaticinitializer.cpp     [License: LGPL(3+eV) LGPL(v3.0) LGPL(v2.1)]

https://invent.kde.org/frameworks/kconfig/commit/d6173cee8d62b241672d98abe9dd6515d2049336