Skip to content

fix: Fix build fail#450

Merged
lzwind merged 2 commits intolinuxdeepin:masterfrom
wangrong1069:pr0204-2
Feb 4, 2026
Merged

fix: Fix build fail#450
lzwind merged 2 commits intolinuxdeepin:masterfrom
wangrong1069:pr0204-2

Conversation

@wangrong1069
Copy link
Contributor

@wangrong1069 wangrong1069 commented Feb 4, 2026

Summary by Sourcery

Adjust build configuration to properly link DTK components and update package versions.

Bug Fixes:

  • Fix CMake configuration by explicitly finding and linking DTK Core and Widget targets and using the appropriate DConfig macro for DTK 6.

Build:

  • Update CMakeLists to use find_package for DTK widgets, link DTK Core/Widget targets, and switch to dtk_add_config_meta_files when building with DTK 6.

Deployment:

  • Bump Linglong package version from 6.5.37.1 to 6.5.38.1 across all architectures.

Find the module dtk6widget by `.cmake` instead of an invalid `.pc`
file. An invalid include path "/usr/include/dtk6/DWidget/dtk6/DWidget"
is provided in the `.pc` file, which will cause the compiler to fail to
read the DWidget header file.

Use `dtk_add_config_meta_files` instead of `dconfig_meta_files` when
the DTK major version is 6.

Log: Fix build fail
As title.

Log: Bump version to 6.5.38
@github-actions
Copy link

github-actions bot commented Feb 4, 2026

TAG Bot

TAG: 6.5.38
EXISTED: no
DISTRIBUTION: unstable

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 4, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts CMake configuration to properly find and link DTK components for Qt builds, updates DConfig handling for DTK 6, and bumps the application version across Linglong packaging files.

Flow diagram for updated DConfig handling based on DTK version

flowchart TD
    A[Configure build] --> B{DTK_VERSION EQUAL 6}
    B -- Yes --> C[Call dtk_add_config_meta_files
APPID org.deepin.camera
FILES org.deepin.camera.encode.json]
    B -- No --> D[Install org.deepin.camera.encode.json
to CMAKE_INSTALL_DATADIR/dsg/configs/org.deepin.camera]
    C --> E[Build and install application]
    D --> E[Build and install application]
Loading

File-Level Changes

Change Details Files
Update DTK discovery and usage in CMake to fix build failures.
  • Add find_package call for Dtk widget module using DTK_VERSION.
  • Remove DTK pkg-config dependencies from the generic 3rd_lib pkg_check_modules block.
  • Link Dtk Core and Widget CMake targets explicitly in both Qt6 and non-Qt6 target_link_libraries branches.
src/CMakeLists.txt
Adjust DConfig meta file handling for DTK 6.
  • Replace DSG_DATA_DIR-based conditional with DTK_VERSION-based check.
  • Use dtk_add_config_meta_files for DTK_VERSION equal to 6 instead of dconfig_meta_files.
  • Retain install fallback path for non-DTK 6 setups.
src/CMakeLists.txt
Bump application version for Linglong packaging across architectures.
  • Update package.version from 6.5.37.1 to 6.5.38.1 in main linglong.yaml.
  • Apply the same version bump in arch-specific Linglong manifests (arm64, loong64, mips64, sw64).
linglong.yaml
arm64/linglong.yaml
loong64/linglong.yaml
mips64/linglong.yaml
sw64/linglong.yaml

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:

  • You are linking against Dtk${DTK_VERSION}::Core but only call find_package(Dtk${DTK_VERSION}Widget REQUIRED); consider adding an appropriate find_package (or COMPONENTS Core Widget) so that the Core target is guaranteed to be defined.
  • The condition if (DTK_VERSION EQUAL "6") is doing a numeric comparison on a string literal; using if (DTK_VERSION STREQUAL "6") (or a more flexible version check) would be clearer and avoid unexpected behavior if DTK_VERSION is not purely numeric.
  • The previous if (DEFINED DSG_DATA_DIR) block for DConfig setup has been replaced with a hard DTK6 check; if you still need to support other DTK versions or configurations, consider preserving or refactoring that logic instead of dropping it outright.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- You are linking against `Dtk${DTK_VERSION}::Core` but only call `find_package(Dtk${DTK_VERSION}Widget REQUIRED)`; consider adding an appropriate `find_package` (or `COMPONENTS Core Widget`) so that the `Core` target is guaranteed to be defined.
- The condition `if (DTK_VERSION EQUAL "6")` is doing a numeric comparison on a string literal; using `if (DTK_VERSION STREQUAL "6")` (or a more flexible version check) would be clearer and avoid unexpected behavior if `DTK_VERSION` is not purely numeric.
- The previous `if (DEFINED DSG_DATA_DIR)` block for DConfig setup has been replaced with a hard DTK6 check; if you still need to support other DTK versions or configurations, consider preserving or refactoring that logic instead of dropping it outright.

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

这份 Git diff 主要涉及 deepin-camera 项目从版本 6.5.37.16.5.38.1 的更新,重点在于构建系统(CMake)的调整以及对不同架构(arm64, loong64, mips64, sw64)的配置文件更新。

以下是对该 diff 的详细审查意见,分为版本号、构建逻辑和代码质量三个方面:

1. 版本号与变更日志

  • 版本一致性
    • 审查结果:通过。
    • 说明arm64, linglong.yaml, loong64, mips64, sw64 等多个目录下的 linglong.yaml 文件中的版本号均已同步从 6.5.37.1 更新为 6.5.38.1。这确保了多架构构建的一致性。
  • Changelog
    • 审查结果:通过。
    • 说明debian/changelog 正确记录了新版本 6.5.38,并注明了修复构建失败的问题。
    • 潜在问题:提交信息中的日期显示为 2026年(Wed, 04 Feb 2026)。这可能是系统时间错误或笔误,建议修正为当前实际年份(如 2024 或 2025),以免造成版本管理混乱。

2. 构建逻辑与依赖管理 (CMakeLists.txt)

这是本次修改的核心部分,主要涉及 DTK (Deepin Tool Kit) 的查找和链接方式的变更。

  • 依赖查找方式变更
    • 变更内容:移除了 pkg_check_modules 中的 dtk${DTK_VERSION}widgetdtk${DTK_VERSION}core,改为使用 find_package(Dtk${DTK_VERSION}Widget REQUIRED)
    • 改进意见逻辑正确,符合现代 CMake 最佳实践
      • 使用 find_package 配合 target_link_libraries (导入的 Dtk::CoreDtk::Widget 目标) 是 CMake 推荐的做法,称为 "Modern CMake"。
      • 这种方式能更好地处理传递依赖,包含正确的包含目录和编译定义,比直接使用 pkg_check_modules 获取 _LIBRARIES_INCLUDE_DIRS 变量更健壮。
  • 链接库的调整
    • 变更内容:在 if (Qt6_FOUND)else() 分支中,都显式添加了 Dtk${DTK_VERSION}::CoreDtk${DTK_VERSION}::Widget
    • 改进意见正确
      • 这确保了无论使用 Qt5 还是 Qt6,都能正确链接 DTK 的 Core 和 Widget 模块。
  • DConfig 配置处理逻辑
    • 变更内容
      # 旧逻辑
      if (DEFINED DSG_DATA_DIR)
          dconfig_meta_files(...)
      else()
          install(FILES ...)
      
      # 新逻辑
      if (DTK_VERSION EQUAL "6")
          dtk_add_config_meta_files(APPID ${APPID} FILES ${configFile})
      else()
          install(FILES ...)
    • 改进意见逻辑优化,但需注意兼容性
      • 优点:新逻辑通过判断 DTK_VERSION 是否为 "6" 来决定使用新的 DTK6 函数 dtk_add_config_meta_files 还是传统的 install 方式。这比旧逻辑中依赖 DSG_DATA_DIR 变量是否定义更直接地关联了 DTK 版本。
      • 风险提示dtk_add_config_meta_files 是 DTK 6 提供的新接口。如果项目仍需支持 DTK 5(即 DTK_VERSION 为 "5" 或其他值),代码会正确走 else 分支进行传统安装。请确认 DTK_VERSION 变量在所有构建环境中(如 CI/CD)都已正确定义。

3. 代码质量与安全性

  • 代码质量
    • 改进:从 pkg_check_modules 迁移到 find_package 提高了构建系统的可维护性和可读性。
    • 建议:确保 Dtk${DTK_VERSION}Widgetfind_package 调用能够自动找到依赖的 DtkCore。通常 DTK 的 Config 文件会处理这种依赖,但此处显式链接了 Dtk::Core 是一种防御性编程,值得肯定。
  • 安全性
    • 本次变更主要是构建系统层面的重构,不直接涉及源代码逻辑,因此不会引入新的代码执行层面的安全漏洞。
    • 依赖库的版本锁定由 DTK_VERSION 变量控制,确保了构建环境的一致性。

总结与建议

  1. 修正日期:请务必修正 debian/changelog 中的年份(2026 -> 实际年份)。
  2. 构建测试
    • 需要在 DTK 6 环境下验证 dtk_add_config_meta_files 是否正确生成了元数据文件并安装到了正确位置。
    • 需要在 DTK 5 环境下(如果仍需支持)验证 install 命令是否依然有效,且 find_package 不会因为找不到 DTK6 的 Config 文件而报错(注意 diff 中只写了 find_package(Dtk${DTK_VERSION}Widget ...),如果 DTK_VERSION 是 5,它会去找 Dtk5Widget,请确保 DTK5 的 CMake 包文件名与之匹配)。
  3. 代码风格:修改后的 CMake 代码风格符合现代规范,无需调整。

总体而言,这是一次针对构建系统的合理重构,旨在修复构建失败并规范化依赖管理。

@lzwind lzwind merged commit 5edc36d into linuxdeepin:master Feb 4, 2026
19 checks passed
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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-bot
Copy link
Contributor

deepin-bot bot commented Feb 4, 2026

TAG Bot

Tag created successfully

📋 Tag Details
  • Tag Name: 6.5.38
  • Tag SHA: 00f9f94fda1ed937d2611117d569985c90b88b12
  • Commit SHA: b3c7f15cb05f09cc40daaf4b6a701f4348210b09
  • Tag Message:
    Release deepin-camera 6.5.38
    
    
  • Tagger:
    • Name: wangrong1069
  • Distribution: unstable

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