build: request Qt CorePrivate/WidgetsPrivate components in application-tray#477
Conversation
|
Hi @svan71. Thanks for your PR. 😃 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR fixes a CMake configuration issue for the application-tray plugin by explicitly requesting the Qt CorePrivate and WidgetsPrivate components that are already linked, ensuring Qt 6.11+ builds configure successfully without affecting runtime behavior. Flow diagram for updated CMake Qt component discoveryflowchart TD
CMakeConfig["CMake configure for application-tray"] --> FindQt["find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets DBus CorePrivate WidgetsPrivate)"]
FindQt --> ImportTargets["Qt6 imported targets available (Core, Widgets, CorePrivate, WidgetsPrivate)"]
ImportTargets --> LinkTray["target_link_libraries(application-tray PRIVATE Qt6::CorePrivate Qt6::WidgetsPrivate)"]
LinkTray --> Success["Configure and build succeed on Qt 6.11+"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Hi @svan71. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA. |
|
|
||
| find_package(PkgConfig REQUIRED) | ||
| find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED Core Gui Widgets DBus) | ||
| find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Widgets DBus CorePrivate WidgetsPrivate) |
There was a problem hiding this comment.
Thanks — updated to version-gate the private component lookup on Qt >= 6.10, matching the existing pattern in this repository and the linked dtklog change. application-tray links both CorePrivate and WidgetsPrivate, so the gated find_package requests both. Clean configure and builds of trayplugin-loader and application-tray pass on Qt 6.11.1.
…n-tray
application-tray links against Qt6::CorePrivate and Qt6::WidgetsPrivate but
only requests the public Core, Gui, Widgets and DBus components. From Qt
6.10 those *Private imported targets are no longer available transitively,
so configuring fails unless the private components are requested explicitly:
CMake Error at plugins/application-tray/CMakeLists.txt:70 (target_link_libraries):
Target "application-tray" links to: Qt6::CorePrivate
but the target was not found.
Gate the private find_package on Qt >= 6.10, matching the pattern used in
dtklog and other Deepin projects, while still requesting both CorePrivate
and WidgetsPrivate because this target links both.
Reproduced on a pristine checkout with Qt 6.11.1.
c450343 to
876e901
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, svan71 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
plugins/application-tray/CMakeLists.txtlinks againstQt6::CorePrivateandQt6::WidgetsPrivate:but only requests the public components:
Those imported targets are only defined when the corresponding
*Privatecomponents are requested. On Qt 6.11.1 this fails at generate time:Reproduced on a pristine checkout of
master@b3d4784(2.0.36) with no other changes, and on2.0.35.Fix
Testing
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Releasefails at generate time with the error above.cmake --build build --target trayplugin-loader).Note
Presumably latent on the Qt version Deepin 25 ships (6.8.0), where these targets may be pulled in transitively. Surfaced on Qt 6.11.1 (Arch Linux).
Summary by Sourcery
Ensure the application-tray plugin correctly finds and links Qt CorePrivate and WidgetsPrivate components.
Bug Fixes:
Build: