Skip to content

Conversation

@18202781743
Copy link
Contributor

Removed the version mapping logic that converted DTK5 and DTK6 version
numbers from x.y.z to 0.y.z format. This change was necessary because
DTK5 and DTK6 now share the same version numbering scheme, eliminating
the need for separate version transformations. The DTK5_MAJOR_MINOR
variable used for shared library dependencies has also been removed as
it's no longer needed with the unified versioning approach.

Influence:

  1. Verify that DTK5 and DTK6 packages build successfully with the same
    version numbers
  2. Test that shared library dependencies are correctly handled without
    version mapping
  3. Check that Build-Profiles (nodtk5/nodtk6) still work as expected
  4. Validate that reproducible build flags remain intact
  5. Ensure clean build process works for both DTK5 and DTK6 directories

fix: 移除DTK5/DTK6统一构建的版本映射逻辑

移除了将DTK5和DTK6版本号从x.y.z格式转换为0.y.z格式的版本映射逻辑。此变更
是必要的,因为DTK5和DTK6现在使用相同的版本编号方案,消除了单独版本转换的
需求。用于共享库依赖的DTK5_MAJOR_MINOR变量也已被移除,因为在统一版本方案
下不再需要。

Influence:

  1. 验证DTK5和DTK6包是否使用相同版本号成功构建
  2. 测试共享库依赖在没有版本映射的情况下是否正确处理
  3. 检查Build-Profiles(nodtk5/nodtk6)是否仍按预期工作
  4. 验证可重现构建标志是否保持完整
  5. 确保DTK5和DTK6目录的清理构建过程正常工作

Removed the version mapping logic that converted DTK5 and DTK6 version
numbers from x.y.z to 0.y.z format. This change was necessary because
DTK5 and DTK6 now share the same version numbering scheme, eliminating
the need for separate version transformations. The DTK5_MAJOR_MINOR
variable used for shared library dependencies has also been removed as
it's no longer needed with the unified versioning approach.

Influence:
1. Verify that DTK5 and DTK6 packages build successfully with the same
version numbers
2. Test that shared library dependencies are correctly handled without
version mapping
3. Check that Build-Profiles (nodtk5/nodtk6) still work as expected
4. Validate that reproducible build flags remain intact
5. Ensure clean build process works for both DTK5 and DTK6 directories

fix: 移除DTK5/DTK6统一构建的版本映射逻辑

移除了将DTK5和DTK6版本号从x.y.z格式转换为0.y.z格式的版本映射逻辑。此变更
是必要的,因为DTK5和DTK6现在使用相同的版本编号方案,消除了单独版本转换的
需求。用于共享库依赖的DTK5_MAJOR_MINOR变量也已被移除,因为在统一版本方案
下不再需要。

Influence:
1. 验证DTK5和DTK6包是否使用相同版本号成功构建
2. 测试共享库依赖在没有版本映射的情况下是否正确处理
3. 检查Build-Profiles(nodtk5/nodtk6)是否仍按预期工作
4. 验证可重现构建标志是否保持完整
5. 确保DTK5和DTK6目录的清理构建过程正常工作
@github-actions
Copy link
Contributor

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

@deepin-ci-robot
Copy link

deepin pr auto review

这段代码的 diff 显示了对 debian/rules 文件的修改,主要是移除了一些版本映射相关的变量定义和 override_dh_makeshlibs 目标。

以下是对这段代码变更的审查意见,分为语法逻辑、代码质量、代码性能和代码安全四个方面:

1. 语法逻辑

  • 变更分析:代码删除了 DTK5_VERSIONDTK6_VERSIONDTK5_MAJOR_MINOR 的计算逻辑,同时也删除了自定义的 override_dh_makeshlibs 目标。
  • 潜在问题
    • 依赖关系缺失:原代码中 override_dh_makeshlibs 使用了 -V 参数来指定依赖版本(例如 libdtklog (>= $(DTK5_MAJOR_MINOR)))。移除该目标后,dh_makeshlibs 将使用默认行为。
    • 默认行为风险dh_makeshlibs 的默认行为通常是为库生成 shlibs 文件,并在 debian/control 中自动计算依赖关系。如果移除了自定义逻辑,系统将回退到默认逻辑。如果之前的逻辑是为了处理特殊的版本映射(如将 5.x.y 映射到 0.x.y 以匹配 ABI),那么移除它可能会导致生成的二进制包依赖关系不正确(例如依赖了错误的版本号,或者依赖了过旧的版本)。
    • 变量残留:虽然 DTK5_MAJOR_MINOR 等变量定义被删除了,但请检查 debian/control 或其他文件(如 debian/*.install 等)中是否还引用了这些变量。如果这些变量不再被使用,删除是合理的;如果其他地方还在用,会导致构建失败。

2. 代码质量

  • 简化与维护性:删除复杂的 sedcut 管道命令可以减少 debian/rules 的复杂性,这是一个积极的改进。如果这些版本映射逻辑不再需要,或者可以通过 CMake/Debian 的标准机制自动处理,那么精简代码是好的。
  • 一致性:代码保留了 BUILD_DTK5BUILD_DTK6 的控制逻辑,说明仍然支持双版本构建。移除 dh_makeshlibs 的自定义处理意味着 DTK5 和 DTK6 的库依赖处理将统一使用标准机制。这提高了代码的一致性,前提是标准机制能满足需求。

3. 代码性能

  • 构建性能:移除 shell 命令(sed, cut, echo)的调用可以略微减少 dpkg-buildpackage 过程中解析 debian/rules 时的开销,尽管这个开销通常非常小,可以忽略不计。对性能影响微乎其微。

4. 代码安全

  • 安全性:此变更主要影响构建系统的逻辑,不直接涉及运行时的代码安全性。
  • 供应链安全(间接):如果移除自定义版本映射导致生成的包依赖关系过松(例如缺少 >= 版本限制),用户在安装该包时可能会链接到 ABI 不兼容的旧版库,从而导致运行时崩溃或安全漏洞未被修复(如果旧版库有已知漏洞)。因此,必须确认移除 override_dh_makeshlibs 后,生成的 debian/*.substvars 文件中的 shlibs:Depends 变量是否正确且严格

总结与改进建议

这段代码变更的意图似乎是简化构建脚本,移除手动的版本号处理,转而依赖 debhelper 的默认行为。

改进建议:

  1. 验证依赖关系:这是最重要的一点。请构建该包,并检查生成的 debian/libdtklog.substvarsdebian/libdtk6log.substvars 文件中的 shlibs:Depends 内容。
    • 确保它包含了正确的版本依赖(例如 libdtklog (>= 5.5.0))。
    • 如果原代码中的 0.y.z 映射是为了解决特殊的 ABI 版本问题,必须确保新的依赖关系依然能防止 ABI 不兼容。
  2. 检查符号文件:如果项目使用了 debian/*.symbols 文件来管理符号版本,请确保 dh_makeshlibs 能够正确结合符号文件生成依赖。通常 dh_makeshlibs 会自动处理,但移除 -V 参数后,依赖版本将完全由符号文件决定。
  3. 文档说明:如果这个变更是有意为之(例如,决定不再支持特殊的版本映射逻辑),建议在提交信息或 debian/changelog 中明确说明原因,例如:"Switch to using standard dh_makeshlibs behavior for dependency calculation."

结论:
从代码清理的角度看,这是一次好的精简。但从功能正确性的角度看,存在高风险。除非你确信 debhelper 的默认行为能够完美替代之前的手动逻辑(特别是版本号处理部分),否则不建议直接合并此变更。务必先进行构建测试,检查生成的依赖关系是否符合预期。

@18202781743 18202781743 requested a review from asterwyx January 21, 2026 03:25
@deepin-ci-robot
Copy link

[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 0d17d79 into linuxdeepin:master Jan 21, 2026
9 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.

3 participants