Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Nov 17, 2025

Added CMAKE_SKIP_BUILD_RPATH=ON flag to DEB_CMAKE_EXTRA_FLAGS for reproducible builds
This change ensures that build paths are not embedded in binaries, making builds more deterministic
The flag is passed to dh_auto_configure command to apply during CMake configuration
This improves package reproducibility across different build environments

Influence:

  1. Verify that builds produce identical binaries when built in different directories
  2. Test that RPATH is not embedded in compiled binaries
  3. Check that package functionality remains unchanged
  4. Validate build process completes successfully with the new flag

feat: 添加可重复编译参数

在DEB_CMAKE_EXTRA_FLAGS中添加CMAKE_SKIP_BUILD_RPATH=ON标志以实现可重复 编译
此更改确保构建路径不会嵌入到二进制文件中,使构建更加确定性
该标志通过dh_auto_configure命令传递给CMake配置过程
这提高了在不同构建环境中软件包的可重复性

Influence:

  1. 验证在不同目录中构建时是否产生相同的二进制文件
  2. 测试编译后的二进制文件中是否未嵌入RPATH
  3. 检查软件包功能是否保持不变
  4. 验证构建过程在使用新标志后能否成功完成

Summary by Sourcery

Enable reproducible builds by adding the CMAKE_SKIP_BUILD_RPATH=ON flag in debian/rules to prevent embedding build paths in binaries and ensure deterministic package outputs across environments

New Features:

  • Add CMAKE_SKIP_BUILD_RPATH=ON flag to DEB_CMAKE_EXTRA_FLAGS

Enhancements:

  • Prevent embedding build paths in binaries for more deterministic builds

Build:

  • Pass the new reproducible build flag to dh_auto_configure in debian/rules

Added CMAKE_SKIP_BUILD_RPATH=ON flag to DEB_CMAKE_EXTRA_FLAGS for
reproducible builds
This change ensures that build paths are not embedded in binaries,
making builds more deterministic
The flag is passed to dh_auto_configure command to apply during CMake
configuration
This improves package reproducibility across different build
environments

Influence:
1. Verify that builds produce identical binaries when built in different
directories
2. Test that RPATH is not embedded in compiled binaries
3. Check that package functionality remains unchanged
4. Validate build process completes successfully with the new flag

feat: 添加可重复编译参数

在DEB_CMAKE_EXTRA_FLAGS中添加CMAKE_SKIP_BUILD_RPATH=ON标志以实现可重复
编译
此更改确保构建路径不会嵌入到二进制文件中,使构建更加确定性
该标志通过dh_auto_configure命令传递给CMake配置过程
这提高了在不同构建环境中软件包的可重复性

Influence:
1. 验证在不同目录中构建时是否产生相同的二进制文件
2. 测试编译后的二进制文件中是否未嵌入RPATH
3. 检查软件包功能是否保持不变
4. 验证构建过程在使用新标志后能否成功完成
@18202781743 18202781743 requested a review from BLumia November 17, 2025 07:08
@sourcery-ai
Copy link

sourcery-ai bot commented Nov 17, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds the CMAKE_SKIP_BUILD_RPATH=ON flag to the Debian packaging configuration to prevent build paths from being embedded in binaries, ensuring reproducible builds across different environments.

File-Level Changes

Change Details Files
Enable CMake reproducible build flag to skip embedding RPATH
  • Append CMAKE_SKIP_BUILD_RPATH=ON to DEB_CMAKE_EXTRA_FLAGS
  • Ensure dh_auto_configure uses the updated flags
debian/rules

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

@18202781743 18202781743 requested a review from mhduiy November 17, 2025 07:08
@github-actions
Copy link
Contributor

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

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 there - 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.

@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

我来对这个git diff进行代码审查:

  1. 语法逻辑审查:

    • 语法是正确的,符合debian/rules文件的格式要求
    • 变量赋值和函数调用都使用了正确的语法
  2. 代码质量改进建议:

    • 建议在添加DEB_CMAKE_EXTRA_FLAGS之前检查该变量是否已定义,可以使用?=操作符:
      DEB_CMAKE_EXTRA_FLAGS ?= -DCMAKE_SKIP_BUILD_RPATH=ON
      
    • 注释中使用了中文"reproducible",建议统一使用英文注释:
      # reproducible build flags
      
  3. 代码性能方面:

    • -DCMAKE_SKIP_BUILD_RPATH=ON参数的添加是合理的,它可以避免在构建过程中添加不必要的RPATH,有助于提高二进制文件的加载性能
  4. 代码安全方面:

    • -DCMAKE_SKIP_BUILD_RPATH=ON参数的使用是安全的,它实际上有助于提高安全性,因为它防止了二进制文件中包含不必要的RPATH信息
    • 建议考虑添加更多的安全相关的编译选项,如:
      -DCMAKE_BUILD_TYPE=RelWithDebInfo
      -DCMAKE_POSITION_INDEPENDENT_CODE=ON
      
  5. 其他建议:

    • 建议将DEB_CMAKE_EXTRA_FLAGS的定义移到文件开头,与其他export变量放在一起,这样更容易维护
    • 可以考虑添加一个注释说明为什么需要设置DCMAKE_SKIP_BUILD_RPATH=ON

改进后的代码建议:

export DEB_CFLAGS_MAINT_APPEND = -Wall
export DEB_CXXFLAGS_MAINT_APPEND = -Wall
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,noexecstack -Wl,-E

# reproducible build flags
DEB_CMAKE_EXTRA_FLAGS ?= -DCMAKE_SKIP_BUILD_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_POSITION_INDEPENDENT_CODE=ON

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

这些改进将使代码更加健壮、安全和易于维护。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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 439f489 into linuxdeepin:master Nov 17, 2025
12 of 14 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