Skip to content

Conversation

@mhduiy
Copy link
Contributor

@mhduiy mhduiy commented Jul 9, 2025

  1. Added deepin-face.install to install library configuration
  2. Implemented postinst and postrm scripts for ldconfig management
  3. Updated debian/rules with additional hardening flags
  4. Removed redundant security flags from .pro file as they're now handled by Debian build
  5. Added deepin-face.conf for library path configuration

The changes improve package management by:

  • Properly handling library cache updates during install/remove
  • Centralizing security hardening in Debian build system
  • Simplifying project configuration by removing redundant flags
  • Ensuring consistent library path configuration

feat: 添加 Debian 打包配置

  1. 添加 deepin-face.install 用于安装库配置
  2. 实现 postinst 和 postrm 脚本管理 ldconfig
  3. 更新 debian/rules 添加额外的安全加固标志
  4. 从 .pro 文件中移除冗余的安全标志,现在由 Debian 构建系统处理
  5. 添加 deepin-face.conf 用于库路径配置

这些改进通过以下方式优化了包管理:

  • 正确管理安装/删除时的库缓存更新
  • 在 Debian 构建系统中集中处理安全加固
  • 通过移除冗余标志简化项目配置
  • 确保一致的库路径配置

Summary by Sourcery

Add Debian packaging support for deepin-face by introducing install rules and configuration, integrating security hardening in the build, and automating library cache and path management.

Enhancements:

  • Centralize security hardening by moving compile and link flags into the Debian build configuration
  • Remove redundant security flags from the project file to simplify upstream configuration
  • Automate library cache updates and path setup by adding ldconfig management scripts and a configuration file

Build:

  • Update debian/rules to apply additional hardening flags during package build

Deployment:

  • Add Debian packaging files: deepin-face.install, deepin-face.conf, postinst, and postrm

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 @mhduiy - I've reviewed your changes - here's some feedback:

  • The new deepin-face.conf file is under msic/ instead of debian/; move it into debian/ and ensure it’s installed to /etc/ld.so.conf.d/ with the proper multiarch path.
  • Populate debian/deepin-face.install with the actual library and config files (e.g. the .so files and the .conf) so they get included in the final package.
  • Replace the hardcoded /usr/lib/auto paths with $(DEB_HOST_MULTIARCH) in both the .install and .conf to ensure compatibility with multiarch systems.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new deepin-face.conf file is under `msic/` instead of `debian/`; move it into `debian/` and ensure it’s installed to `/etc/ld.so.conf.d/` with the proper multiarch path.
- Populate `debian/deepin-face.install` with the actual library and config files (e.g. the .so files and the .conf) so they get included in the final package.
- Replace the hardcoded `/usr/lib/auto` paths with `$(DEB_HOST_MULTIARCH)` in both the .install and .conf to ensure compatibility with multiarch systems.

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.

@sourcery-ai
Copy link

sourcery-ai bot commented Jul 9, 2025

Reviewer's Guide

This PR adds full Debian packaging support for deepin-face by introducing installation scripts and configuration for library deployment and ldconfig management, bolstering build hardening via updated rules, and cleaning up redundant security flags from the project file.

Flow diagram for library installation and ldconfig management

flowchart TD
    A[Install package] --> B[Install library and config via deepin-face.install]
    B --> C[Run postinst script]
    C --> D[Execute ldconfig to update cache]
    D --> E[Library available system-wide]
    E --> F[Uninstall package]
    F --> G[Run postrm script]
    G --> H[Execute ldconfig to update cache]
    H --> I[Library removed from system cache]
Loading

File-Level Changes

Change Details Files
Establish Debian packaging and library configuration
  • Add .install file to specify library installation paths
  • Introduce configuration file for library path
  • Include postinst script to update ldconfig on install
  • Include postrm script to update ldconfig on removal
debian/deepin-face.install
msic/deepin-face.conf
debian/postinst
debian/postrm
Harden Debian build via updated rules
  • Add extra compiler hardening flags
  • Add extra linker hardening flags
debian/rules
Clean up project build by removing redundant security flags
  • Remove manual QMAKE_CFLAGS and QMAKE_CXXFLAGS
  • Remove manual QMAKE_LFLAGS
  • Remove manual QMAKE_RPATHDIR setting
deepin-face.pro

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

1. Added deepin-face.install to install library configuration
2. Implemented postinst and postrm scripts for ldconfig management
3. Updated debian/rules with additional hardening flags
4. Removed redundant security flags from .pro file as they're now
handled by Debian build
5. Added deepin-face.conf for library path configuration

The changes improve package management by:
- Properly handling library cache updates during install/remove
- Centralizing security hardening in Debian build system
- Simplifying project configuration by removing redundant flags
- Ensuring consistent library path configuration

feat: 添加 Debian 打包配置

1. 添加 deepin-face.install 用于安装库配置
2. 实现 postinst 和 postrm 脚本管理 ldconfig
3. 更新 debian/rules 添加额外的安全加固标志
4. 从 .pro 文件中移除冗余的安全标志,现在由 Debian 构建系统处理
5. 添加 deepin-face.conf 用于库路径配置

这些改进通过以下方式优化了包管理:
- 正确管理安装/删除时的库缓存更新
- 在 Debian 构建系统中集中处理安全加固
- 通过移除冗余标志简化项目配置
- 确保一致的库路径配置
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. .reuse/dep5 文件中的 Files 列表新增了 msic/deepin-face.conf 文件,但未提供该文件的版权和许可证信息。建议补充这些信息以保持文件清单的完整性。

  2. debian/deepin-face.install 文件新增了安装路径,但没有检查目标路径是否存在。建议在安装之前检查路径是否存在,以避免安装失败。

  3. debian/postinstdebian/postrm 脚本中使用了 ldconfig 命令来更新动态链接器缓存。建议添加错误处理逻辑,以防止 ldconfig 命令执行失败时脚本退出。

  4. debian/rules 文件中移除了 DEB_CFLAGS_MAINT_APPENDDEB_LDFLAGS_MAINT_APPEND 的默认值,但未提供新的值。建议确认这些变量的新值是否正确设置。

  5. deepin-face.pro 文件中移除了安全编译参数,但未提供替代的安全编译参数。建议恢复这些安全编译参数,或者提供替代的安全编译参数。

  6. msic/deepin-face.conf 文件中只包含了一行 /usr/lib/auto,这可能是为了指定动态库的搜索路径。建议确认这一路径是否正确,并且该路径下的库文件是否存在。

  7. 代码中没有发现明显的语法或逻辑错误,但建议进行更全面的代码审查,以确保代码质量和性能。

  8. 代码中没有发现明显的安全漏洞,但建议进行更全面的安全审查,以确保代码的安全性。

总体来说,代码的改动主要集中在文件路径的修改和安装脚本的增加,没有引入新的功能或逻辑。建议在合并这些改动之前,进行更全面的代码审查,以确保代码的质量和安全性。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia, 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

@BLumia BLumia merged commit 4c185a9 into linuxdeepin:master Jul 9, 2025
8 of 9 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.

4 participants