Skip to content

build(cmake): refactor Qt version compatibility#416

Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
re2zero:bugfix
Jan 27, 2026
Merged

build(cmake): refactor Qt version compatibility#416
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
re2zero:bugfix

Conversation

@re2zero
Copy link
Contributor

@re2zero re2zero commented Jan 27, 2026

  • Separate debian/control files:
    • control: V25 (Qt6) with explicit qt6-base-dev, libdtk6*-dev deps
    • control.1: V20 (Qt5) with explicit qtbase5-dev, libdtk*-dev deps

This enables seamless building on both V25 (Qt6) and V20 (Qt5) systems without version-specific conditional dependencies.

Log: 分离Qt5/Qt6构建配置,支持V25/V20双版本
PMS: https://pms.uniontech.com/task-view-386321.html

Summary by Sourcery

Build:

  • Add a Debian debian/control.1 file defining Qt5-based build and runtime dependencies for deepin-editor, alongside the existing Qt6-oriented control file.

- Separate debian/control files:
  * control: V25 (Qt6) with explicit qt6-base-dev, libdtk6*-dev deps
  * control.1: V20 (Qt5) with explicit qtbase5-dev, libdtk*-dev deps

This enables seamless building on both V25 (Qt6) and V20 (Qt5) systems
without version-specific conditional dependencies.

Log: 分离Qt5/Qt6构建配置,支持V25/V20双版本
PMS: https://pms.uniontech.com/task-view-386321.html
@github-actions
Copy link

  • 检测到debian目录文件有变更: debian/control.1,debian/control

@sourcery-ai
Copy link

sourcery-ai bot commented Jan 27, 2026

Reviewer's Guide

Refactors Debian packaging to support parallel Qt5 (V20) and Qt6 (V25) builds by splitting the control file into Qt-version-specific variants and updating dependencies accordingly.

Flow diagram for selecting Debian control file for Qt5/Qt6 builds

flowchart TD
    Start["Start Debian package build"] --> DetectEnv["Detect build environment version"]

    DetectEnv -->|V25 with Qt6| UseControlQt6["Use debian/control (Qt6 config)"]
    DetectEnv -->|V20 with Qt5| UseControlQt5["Use debian/control.1 (Qt5 config)"]

    UseControlQt6 --> InstallQt6Deps["Install Qt6 and DTK6 build dependencies"]
    UseControlQt5 --> InstallQt5Deps["Install Qt5 and DTK5 build dependencies"]

    InstallQt6Deps --> ConfigureBuild["Configure and build deepin-editor"]
    InstallQt5Deps --> ConfigureBuild

    ConfigureBuild --> BuildDeb["Produce .deb package for target system"]
    BuildDeb --> End["End"]
Loading

File-Level Changes

Change Details Files
Introduce a separate Debian control file for Qt5 (V20) builds while keeping the primary control file for Qt6 (V25).
  • Keep debian/control as the Qt6/V25 control definition (not fully shown in diff) with Qt6 and libdtk6-related dependencies as implied by the PR description
  • Add debian/control.1 as a Qt5/V20 control definition with explicit Qt5 (qtbase5, qttools5, libqt5svg5) and non-Qt6 dtk dependencies
  • Align package metadata in debian/control.1 (Source, Maintainer, Uploaders, Rules-Requires-Root, Standards-Version, Package fields, Architecture, Depends, Description, Recommends) for the Qt5 build
debian/control
debian/control.1
Minor repo housekeeping for packaging artifacts.
  • Adjust .gitignore to match new or existing packaging/build artifacts (exact entries not shown in diff)
.gitignore

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new debian/control.1 largely duplicates metadata from debian/control (maintainer, Standards-Version, description, etc.); consider reducing duplication or adding a clear process/mechanism to keep these fields in sync to avoid subtle divergence between Qt5/Qt6 builds over time.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new debian/control.1 largely duplicates metadata from debian/control (maintainer, Standards-Version, description, etc.); consider reducing duplication or adding a clear process/mechanism to keep these fields in sync to avoid subtle divergence between Qt5/Qt6 builds over time.

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.

@deepin-ci-robot
Copy link

deepin pr auto review

这段代码变更主要涉及 Deepin 编辑器项目的依赖包升级(从 Qt5/Dtk5 迁移到 Qt6/Dtk6),以及 .gitignore 文件的更新。以下是我的审查意见:

1. 语法逻辑审查

结论:语法正确,逻辑清晰。

  • debian/control: 修改了 Build-DependsDepends 字段,将备选依赖(|)移除,仅保留 Qt6 和 DTK6 的包。这种写法在 Debian 控制文件中是合法的,表示强制依赖特定版本的新库。
  • debian/control.1: 这是一个新文件,语法符合 Debian 打包规范,看起来像是用于维护 Qt5 版本的备份或分支配置。
  • .gitignore: 增加了一行 .claude/,语法正确。

2. 代码质量审查

存在潜在风险,建议改进。

  • 破坏性更新:

    • debian/control 中移除了 qt5dtk5 的备选依赖(例如 qt6-base-dev | qtbase5-dev),这意味着该软件包将无法在尚未升级到 Qt6/Dtk6 的系统上编译或安装
    • 建议: 确认目标发行版环境是否已经全面支持 Qt6/Dtk6。如果这是一个需要向后兼容的更新,保留备选依赖是更稳妥的做法;如果这是针对特定新系统(如 Debian 12+ 或 Deepin V23+)的专项升级,则当前修改是合理的,但需在提交信息中明确说明环境要求。
  • 版本号管理:

    • debian/controllibdtk6widget 没有指定版本号(如 (>= x.y.z)),而在 debian/control.1 中保留了 libdtkwidget5 (>= 5.4.11)
    • 建议: DTK6 通常引入了不兼容的 API 变更,建议明确 libdtk6widget 的最低版本要求,以防止用户安装了过旧的 DTK6 库导致编译失败或运行时崩溃。

3. 代码性能审查

不适用。

  • 此处为构建配置文件的修改,不涉及运行时代码,因此对程序运行时的性能没有直接影响。不过,Qt6 相比 Qt5 通常有更好的渲染性能,这是架构升级带来的红利。

4. 代码安全审查

注意依赖库的变更。

  • 依赖库安全: Qt6 和 DTK6 相比旧版本通常包含了大量的安全修复和漏洞补丁。升级到这些新库有助于提高软件的安全性。
  • Supply Chain (供应链): debian/control.1 文件的出现显得有些突兀。它包含了一份完整的 Qt5 依赖配置。
    • 风险: 如果这个文件被意外包含在构建过程中,可能会导致依赖冲突或混乱。
    • 建议: 确认 debian/control.1 的用途。如果是备份,建议移出源代码仓库或添加到 .gitignore 中,以免干扰自动化构建工具(通常自动化工具只读取 debian/control)。

5. 其他建议

  • 提交信息: 建议在 Commit Message 中明确指出此次变更将系统依赖提升至 Qt6/Dtk6,并注明不再支持旧版系统。
  • 文件清理: 检查 debian/control.1 是否应该被提交。如果是为了保留 Qt5 分支,建议使用 Git 分支管理,而不是在主分支中保留一个名为 .1 的配置文件。

总结

这次修改是一次重大的依赖库升级。主要风险在于移除了向后兼容性。请确保目标环境已经完全准备好支持 Qt6 和 DTK6。此外,请务必检查 debian/control.1 文件存在的必要性,避免造成构建系统混淆。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, re2zero

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

@re2zero
Copy link
Contributor Author

re2zero commented Jan 27, 2026

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Jan 27, 2026

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit 1a362df into linuxdeepin:master Jan 27, 2026
20 of 21 checks passed
@re2zero re2zero deleted the bugfix branch January 27, 2026 05:40
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.

3 participants