Skip to content

fix: remove DTK version mapping for unified build#720

Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743:unify
Jan 21, 2026
Merged

fix: remove DTK version mapping for unified build#720
18202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743:unify

Conversation

@18202781743
Copy link
Contributor

Removed DTK5 and DTK6 version mapping logic from debian/rules file. The
DTK5_VERSION, DTK6_VERSION, and DTK5_MAJOR_MINOR variables are no longer
needed since DTK5 and DTK6 now use consistent version numbers. Also
removed the override_dh_makeshlibs target that was using these version
variables for setting shared library dependencies.

This change is part of the DTK unified build transformation where DTK5
and DTK6 versions are now aligned, eliminating the need for separate
version mapping logic. The build system can now use the same version
numbers for both DTK5 and DTK6 components.

Influence:

  1. Verify that DTK5 and DTK6 packages build successfully without version
    mapping
  2. Test that shared library dependencies are correctly handled without
    manual version overrides
  3. Ensure build profiles (nodtk5, nodtk6) still work correctly
  4. Check that documentation builds properly with BUILD_DOCS flag
  5. Validate that both build5 and build6 directories are still properly
    cleaned

fix: 移除DTK版本映射以实现统一构建

从debian/rules文件中移除了DTK5和DTK6版本映射逻辑。由于DTK5和DTK6现在使用
一致的版本号,不再需要DTK5_VERSION、DTK6_VERSION和DTK5_MAJOR_MINOR变量。
同时移除了使用这些版本变量设置共享库依赖的override_dh_makeshlibs目标。

此变更是DTK统一构建改造的一部分,DTK5和DTK6版本现已对齐,无需单独的版本
映射逻辑。构建系统现在可以为DTK5和DTK6组件使用相同的版本号。

Influence:

  1. 验证DTK5和DTK6包在没有版本映射的情况下能成功构建
  2. 测试共享库依赖在没有手动版本覆盖的情况下能正确处理
  3. 确保构建配置文件(nodtk5、nodtk6)仍能正常工作
  4. 检查文档构建是否仍能正确使用BUILD_DOCS标志
  5. 验证build5和build6目录是否仍能被正确清理

Removed DTK5 and DTK6 version mapping logic from debian/rules file. The
DTK5_VERSION, DTK6_VERSION, and DTK5_MAJOR_MINOR variables are no longer
needed since DTK5 and DTK6 now use consistent version numbers. Also
removed the override_dh_makeshlibs target that was using these version
variables for setting shared library dependencies.

This change is part of the DTK unified build transformation where DTK5
and DTK6 versions are now aligned, eliminating the need for separate
version mapping logic. The build system can now use the same version
numbers for both DTK5 and DTK6 components.

Influence:
1. Verify that DTK5 and DTK6 packages build successfully without version
mapping
2. Test that shared library dependencies are correctly handled without
manual version overrides
3. Ensure build profiles (nodtk5, nodtk6) still work correctly
4. Check that documentation builds properly with BUILD_DOCS flag
5. Validate that both build5 and build6 directories are still properly
cleaned

fix: 移除DTK版本映射以实现统一构建

从debian/rules文件中移除了DTK5和DTK6版本映射逻辑。由于DTK5和DTK6现在使用
一致的版本号,不再需要DTK5_VERSION、DTK6_VERSION和DTK5_MAJOR_MINOR变量。
同时移除了使用这些版本变量设置共享库依赖的override_dh_makeshlibs目标。

此变更是DTK统一构建改造的一部分,DTK5和DTK6版本现已对齐,无需单独的版本
映射逻辑。构建系统现在可以为DTK5和DTK6组件使用相同的版本号。

Influence:
1. 验证DTK5和DTK6包在没有版本映射的情况下能成功构建
2. 测试共享库依赖在没有手动版本覆盖的情况下能正确处理
3. 确保构建配置文件(nodtk5、nodtk6)仍能正常工作
4. 检查文档构建是否仍能正确使用BUILD_DOCS标志
5. 验证build5和build6目录是否仍能被正确清理
@github-actions
Copy link
Contributor

  • 检测到debian目录文件有变更: debian/rules

@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

这段代码是针对 debian/rules 文件的修改,主要涉及删除了关于 DTK5 和 DTK6 的版本映射变量定义以及 override_dh_makeshlibs 目标的自定义逻辑。

以下是对该修改的审查意见,涵盖语法逻辑、代码质量、代码性能和代码安全四个方面:

1. 语法逻辑

  • 现状:修改删除了 DTK5_VERSION, DTK6_VERSION, DTK5_MAJOR_MINOR 变量的定义,以及 override_dh_makeshlibs 的实现。
  • 潜在风险
    • 版本依赖丢失override_dh_makeshlibs 的核心作用是通过 -V 参数指定共享库的依赖关系(例如 libdtkwidget5 (>= 5.x.y))。删除这段代码后,dh_makeshlibs 将使用默认行为生成依赖关系。
    • 默认行为的不确定性:默认情况下,dh_makeshlibs 可能会生成较弱的依赖(如仅依赖包名而不带版本号),或者依赖当前构建的版本号($(DEB_VERSION_UPSTREAM)),这可能导致运行时链接了不兼容的旧版本库,或者在新版本构建时错误地限制了旧版本的兼容性。
    • 未定义变量引用:请确认 debian/control 文件或其他构建脚本中是否引用了被删除的 DTK5_VERSION 等变量。如果后续脚本(如 execute_after_dh_auto_install)依赖这些变量来生成符号链接或配置文件,构建将会失败。

2. 代码质量

  • 现状:代码移除了复杂的 sedcut 管道处理,以及条件判断逻辑。
  • 改进意见
    • 简化与可维护性:如果删除这些变量和逻辑是有意为之(例如,通过 debian/*.symbols 文件来管理版本依赖,或者上游 CMake 配置已经正确处理了 soversion),那么这简化了 rules 文件,提高了可读性。
    • 文档化:由于删除了显式的版本控制逻辑,建议在 debian/changelog 或提交信息中明确说明原因(例如:"现在依赖符号文件管理库版本依赖"),以便后续维护者理解为何不再在 rules 中处理版本映射。

3. 代码性能

  • 现状:删除了构建阶段外的 shell 命令调用(dpkg-architecture, sed, cut)。
  • 改进意见
    • 正面影响:这是一个微小的性能提升。虽然 sedcut 执行很快,但在构建过程中减少外部进程调用总是有益的。

4. 代码安全

  • 现状:移除了基于 shell 变量的版本字符串处理。
  • 改进意见
    • 减少解析风险:原代码使用 sed 解析版本号。如果版本号格式异常(虽然 DEB_VERSION_UPSTREAM 通常由 dpkg-source 控制,格式较规范),可能会产生意外的字符串。移除这部分逻辑消除了这种潜在的解析风险。
    • 依赖一致性:如果移除 override_dh_makeshlibs 导致依赖关系由 dh_makeshlibs 自动生成,需确保自动生成的依赖关系足够严格,防止下游应用链接了 ABI 不兼容的旧版本库造成运行时崩溃。

总结与建议

这段修改可能是正确的,前提是项目已经采用了更现代或更标准的 Debian 打包实践来替代被删除的逻辑。

关键检查点

  1. 符号文件:请检查 debian/ 目录下是否存在 libdtkwidget5.symbolslibdtk6widget.symbols 文件。如果存在且维护良好,那么删除 override_dh_makeshlibs 是合理的,因为 dh_makeshlibs 会自动利用符号文件生成精确的版本依赖。
  2. CMake 配置:检查上游 CMakeLists.txt 是否正确设置了 SOVERSION,确保生成的 .so 文件名包含正确的版本号(如 libdtkwidget5.so.5.x.y)。
  3. 变量引用:全局搜索代码库,确认没有其他地方引用了 DTK5_VERSIONDTK6_VERSION

结论:如果项目已配置好符号文件(.symbols),此改动是正向的简化;否则,这可能会导致生成的二进制包缺少必要的运行时版本依赖约束,属于高风险修改。建议补充符号文件或恢复 override_dh_makeshlibs 逻辑。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, asterwyx

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

@18202781743 18202781743 merged commit 2a2d1a4 into linuxdeepin:master Jan 21, 2026
20 of 22 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.

3 participants