Skip to content

build: request Qt CorePrivate/WidgetsPrivate components in application-tray#477

Open
svan71 wants to merge 1 commit into
linuxdeepin:masterfrom
svan71:fix-qt-private-components
Open

build: request Qt CorePrivate/WidgetsPrivate components in application-tray#477
svan71 wants to merge 1 commit into
linuxdeepin:masterfrom
svan71:fix-qt-private-components

Conversation

@svan71

@svan71 svan71 commented Jul 9, 2026

Copy link
Copy Markdown

plugins/application-tray/CMakeLists.txt links against Qt6::CorePrivate and Qt6::WidgetsPrivate:

target_link_libraries(${PLUGIN_NAME} PRIVATE ... Qt6::CorePrivate Qt6::WidgetsPrivate ...)

but only requests the public components:

find_package(Qt${QT_VERSION_MAJOR} ${REQUIRED_QT_VERSION} REQUIRED Core Gui Widgets DBus)

Those imported targets are only defined when the corresponding *Private components are requested. On Qt 6.11.1 this fails at generate time:

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.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Reproduced on a pristine checkout of master @ b3d4784 (2.0.36) with no other changes, and on 2.0.35.

Fix

-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)

Testing

  • Arch Linux, Qt 6.11.1, CMake 4.3.4, Ninja.
  • Before: cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release fails at generate time with the error above.
  • After: configures and builds cleanly (cmake --build build --target trayplugin-loader).
  • Build-only change; no runtime behaviour is affected.

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:

  • Fix CMake configuration failure when building the application-tray plugin with Qt 6.11.1 due to missing CorePrivate and WidgetsPrivate imported targets.

Build:

  • Update application-tray CMake configuration to request Qt CorePrivate and WidgetsPrivate components explicitly via find_package.

…n-tray

application-tray links against Qt6::CorePrivate and Qt6::WidgetsPrivate but
only requests the public Core, Gui, Widgets and DBus components. Those
imported targets only exist when the matching *Private components are
requested, so configuring fails on Qt 6.11:

  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.

Reproduced on a pristine checkout with no other changes.
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: svan71

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown

Hi @svan71. Thanks for your PR. 😃

@sourcery-ai

sourcery-ai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The 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 discovery

flowchart 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+"]
Loading

File-Level Changes

Change Details Files
Ensure Qt private component targets are available by updating the Qt find_package invocation in the application-tray plugin CMake configuration.
  • Add REQUIRED COMPONENTS keyword to Qt find_package call.
  • Explicitly request CorePrivate and WidgetsPrivate components alongside existing Core, Gui, Widgets, and DBus components.
  • Keep all other build configuration and linkage unchanged.
plugins/application-tray/CMakeLists.txt

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@svan71

svan71 commented Jul 9, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA.

@svan71

svan71 commented Jul 9, 2026

Copy link
Copy Markdown
Author

For context: #478 is the fix this build change unblocks. plugins/application-tray does not configure on Qt 6.11 without this PR, so #478 depends on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants