Skip to content

fix: cannot build on Archlinux#1176

Merged
BLumia merged 1 commit into
linuxdeepin:masterfrom
justforlxz:master
Jul 2, 2025
Merged

fix: cannot build on Archlinux#1176
BLumia merged 1 commit into
linuxdeepin:masterfrom
justforlxz:master

Conversation

@justforlxz

@justforlxz justforlxz commented Jul 2, 2025

Copy link
Copy Markdown
Member

dock use some only deepin of qt api.

Log:

Summary by Sourcery

Detect and conditionally enable Deepin Qt WaylandCompositor extensions at build time to restore compatibility on Arch Linux distributions without Deepin Qt.

Bug Fixes:

  • Fix build failures on Arch Linux by guarding Deepin Qt–specific Wayland extensions behind a detection macro.

Enhancements:

  • Introduce a CMake try_compile check for Deepin Qt’s WaylandCompositor private API and define USE_DEEPIN_QT when present.
  • Conditionally include and initialize private QtWayland extension headers in the dock plugin only when Deepin Qt is detected.

Build:

  • Extend Qt component requirements to include WaylandCompositor modules.
  • Configure CMake to detect and flag Deepin Qt availability via a test source file.

Tests:

  • Add a compile‐only test in tests/check to validate Deepin Qt WaylandCompositor support.

@justforlxz justforlxz requested review from 18202781743 and BLumia July 2, 2025 04:45
@sourcery-ai

sourcery-ai Bot commented Jul 2, 2025

Copy link
Copy Markdown

Reviewer's Guide

This PR implements build-time detection of Deepin Qt’s Wayland API on Archlinux by integrating a try_compile check, adds required Qt Wayland components, and wraps Deepin-specific QtWayland extensions in conditional compilation.

Entity relationship diagram for added Qt Wayland components

erDiagram
    QT_CORE ||--o{ QT_GUI : uses
    QT_GUI ||--o{ QT_CONCURRENT : uses
    QT_GUI ||--o{ QT_QUICK : uses
    QT_GUI ||--o{ QT_WAYLANDCLIENT : uses
    QT_GUI ||--o{ QT_WAYLANDCOMPOSITOR : uses
    QT_WAYLANDCOMPOSITOR ||--o{ QT_WAYLANDCOMPOSITORPRIVATE : uses
Loading

File-Level Changes

Change Details Files
Detect Deepin Qt at build time via CMake.
  • Configure a test source file via configure_file
  • Invoke try_compile against QtWaylandCompositorPrivate and QtWaylandCompositor
  • Define USE_DEEPIN_QT on successful compile and emit status messages
CMakeLists.txt
Include WaylandCompositor in Qt package requirements.
  • Add WaylandCompositor to Qt${QT_VERSION_MAJOR} find_package components
CMakeLists.txt
Conditionally include and instantiate private QtWayland extensions.
  • Wrap qwlqtkey and qwlqttouch header includes in #ifdef USE_DEEPIN_QT
  • Guard creation of QtKeyExtensionGlobal and TouchExtensionGlobal with USE_DEEPIN_QT
panels/dock/pluginmanagerextension.cpp
Add Deepin Qt detection test source.
  • Introduce tests/check/main.cpp that instantiates QtWayland key extension to validate API availability
tests/check/main.cpp

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

@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 @justforlxz - 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.

18202781743
18202781743 previously approved these changes Jul 2, 2025
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: justforlxz

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

1 similar comment
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: justforlxz

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

dock use some only deepin of qt api.

Log:
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

代码审查意见:

CMakeLists.txt 文件修改:

  • find_package 中添加了 WaylandCompositor 组件,这是一个好的做法,可以确保项目能够找到所需的库。
  • 新增的 try_compile 命令用于检测是否支持 Deepin Qt,这是一个合理的做法,但需要确保 compile_output 的输出被正确处理,以便在编译失败时提供有用的信息。

pluginmanagerextension.cpp 文件修改:

  • initialize 函数中添加了 #ifdef USE_DEEPIN_QT 宏保护,这是一个好的做法,可以避免在不支持 Deepin Qt 的环境中编译错误。
  • 添加了 // TODO: Use built-in protocol instead of qt 注释,这是一个好的实践,提醒将来需要替换为内置协议。

qt_wayland_keyextension.cpp 文件修改:

  • 新增了一个测试文件,用于检测 QtWayland 的 QtKeyExtensionGlobal 类是否可以正常编译。这是一个好的做法,可以确保相关代码的兼容性。

总体来说,代码修改是合理的,但需要注意以下几点:

  • 确保新增的 try_compile 命令的输出被正确处理,以便在编译失败时提供有用的信息。
  • pluginmanagerextension.cpp 文件中,如果 USE_DEEPIN_QT 未定义,则 QtWayland::QtKeyExtensionGlobalQtWayland::TouchExtensionGlobal 的实例化代码将不会执行,这可能会导致功能缺失。建议添加相应的错误处理或日志记录。
  • qt_wayland_keyextension.cpp 文件中,new QtWayland::QtKeyExtensionGlobal(nullptr); 这行代码没有实际意义,因为它没有将实例存储在变量中,也没有调用任何方法。建议移除这行代码或添加有意义的使用场景。

@BLumia BLumia merged commit 3f9960d into linuxdeepin:master Jul 2, 2025
7 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants