Skip to content

fix(debian): keep *.a files in the generated source tarball - #8

Merged
lzwind merged 1 commit into
linuxdeepin:mainfrom
Zeno-sole:fix/native-source-tar-ignore
Sep 24, 2026
Merged

lzwind merged 1 commit into
linuxdeepin:mainfrom
Zeno-sole:fix/native-source-tar-ignore

Conversation

@Zeno-sole

@Zeno-sole Zeno-sole commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

fix(debian): drop libteststatic.a from vendored checksums so OBS builds
OBS generates the source tarball through obs_gbp (gbp buildpackage), whose
export + dpkg-source chain strips *.a files from the tarball regardless of
debian/source/options (the options file is read, but the stripping happens
during the service's tarball generation). As a result

vendor/system-deps/src/tests/lib/libteststatic.a

(a zero-byte fixture inside the vendored system-deps crate) is absent from
the BUILD tree, yet vendor/system-deps/.cargo-checksum.json lists it, so
cargo aborts every offline build with

error: failed to calculate checksum of:
vendor/system-deps/src/tests/lib/libteststatic.a
Caused by: No such file or directory (os error 2)

The file is a 0-byte test fixture (its recorded checksum is the empty-file
SHA-256) and is never linked or read during the build, so removing its
entry from the vendored crate's .cargo-checksum.json is safe: cargo then
no longer requires the file to exist, and the same OBS tarball builds
cleanly. Verified locally on the exact OBS-generated tarball: cargo build
--release --offline --locked completes in ~57s with all packages produced.

Log: 移除 vendored 空 .a 的 checksum 条目修复 OBS 构建
Influence: 本地工作树内 dpkg-buildpackage 依旧正常(该空文件仍在树中)

@sourcery-ai

sourcery-ai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adds Debian source-package filtering configuration so generated tarballs retain the Cargo-validated vendored static library required for offline OBS builds, while omitting unused Windows static libraries; verification confirms successful builds from the unpacked tarball.

File-Level Changes

Change Details Files
Overrides dpkg-source tarball filtering to preserve the vendored static library required by Cargo while excluding unused Windows-only archives.
  • Adds Debian source options that restate dpkg’s default tar-ignore patterns without the blanket .a rule.
  • Adds a targeted ignore rule for libwindows.a to avoid shipping unnecessary Windows-target libraries.
  • Ensures vendor/system-deps/src/tests/lib/libteststatic.a remains available in generated 3.0 (native) source tarballs.
debian/source/options

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@Zeno-sole

Copy link
Copy Markdown
Contributor Author

/integrate

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@Zeno-sole

Copy link
Copy Markdown
Contributor Author

/integrate

… builds

OBS generates the source tarball through obs_gbp (gbp buildpackage), whose
export + dpkg-source chain strips *.a files from the tarball regardless of
debian/source/options (the options file is read, but the stripping happens
during the service's tarball generation). As a result

  vendor/system-deps/src/tests/lib/libteststatic.a

(a zero-byte fixture inside the vendored system-deps crate) is absent from
the BUILD tree, yet vendor/system-deps/.cargo-checksum.json lists it, so
cargo aborts every offline build with

  error: failed to calculate checksum of:
    vendor/system-deps/src/tests/lib/libteststatic.a
  Caused by: No such file or directory (os error 2)

The file is a 0-byte test fixture (its recorded checksum is the empty-file
SHA-256) and is never linked or read during the build, so removing its
entry from the vendored crate's .cargo-checksum.json is safe: cargo then
no longer requires the file to exist, and the same OBS tarball builds
cleanly. Verified locally on the exact OBS-generated tarball: cargo build
--release --offline --locked completes in ~57s with all packages produced.

Log: 移除 vendored 空 .a 的 checksum 条目修复 OBS 构建
Influence: 本地工作树内 dpkg-buildpackage 依旧正常(该空文件仍在树中)
@Zeno-sole
Zeno-sole force-pushed the fix/native-source-tar-ignore branch from 81403cb to 392f376 Compare September 24, 2026 10:21
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 100 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 总体评分 100 分,大于 70 分通过阈值。本次变更从 vendored crate 的 .cargo-checksum.json 中移除了 libteststatic.a(0字节测试夹具文件)的 checksum 条目,修复了 OBS 构建系统剥离 *.a 文件后 cargo 离线构建失败的问题。变更最小化、目标明确、无安全风险。

🔍 详细分析

1. 语法逻辑 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 语法正确,逻辑清晰。JSON 格式在移除条目后仍然有效,libteststatic.a 是0字节测试夹具文件,OBS 构建时会被剥离,移除其 checksum 条目后 cargo 不再检查该文件,逻辑合理。


2. 代码质量 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 代码结构清晰,注释完整。变更最小化,仅移除一个 JSON 条目,目标明确。文件本身包含 $comment 字段说明文件用途。


3. 代码性能 ✅

评价: 优秀 ✅ 通过

潜在问题:
✅ 未发现明显问题

建议: 性能良好,资源使用合理。这是构建配置文件变更,对运行时性能无影响。


4. 代码安全 🔒

评价: 优秀 ✅ 通过

🔐 发现 0 个安全漏洞

安全漏洞详情:
✅ 未发现安全漏洞

建议: 无安全风险。文件本身声明不是安全机制(This file only protects against accidental modifications. It is not a security mechanism),移除0字节测试文件的 checksum 条目不引入任何安全风险。


💡 改进建议代码示例

// 本次变更无需改进代码示例
// 变更内容:从 vendor/system-deps/.cargo-checksum.json 的 files 对象中
// 移除 "src/tests/lib/libteststatic.a" 条目
// 该文件是0字节测试夹具,OBS构建时被剥离,移除checksum条目可修复cargo离线构建

本报告由 AI 代码审查工具自动生成

@lzwind
lzwind merged commit 9455573 into linuxdeepin:main Sep 24, 2026
14 checks passed
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, Zeno-sole

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

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