mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-30 06:22:53 +00:00
ci(release): 验证产物改用 >/dev/null 而非 grep -q —— SIGPIPE 误杀检测
## 问题(第二次试发布实测)
打包成功后,「验证产物」步骤失败:
tar: stdout: write error
dpkg-deb: error: tar subprocess returned error exit status 2
而三个 deb 的元数据其实已全部正确打印(Package/Version/Architecture)。
## 根因
`dpkg-deb -c <800M 的 full 包> | grep -q <模型文件>`:
grep -q 匹配到目标行后**立即退出**、关闭管道读端 ⇒ dpkg-deb 内部的
tar 继续写 stdout 时收到 EPIPE ⇒ pipefail 判整条 pipeline 失败。
⇒ 检测项本身是好的(模型确实在包里),却被检测手段误杀。
本地用 CI 上同一个 800M full 包复现:
grep -q 版 → dpkg-deb: error: tar subprocess was killed by
signal (Broken pipe)
>/dev/null 版 → 通过
client(80M)没炸、full(800M)炸 —— 包越大越容易触发(内容越多,
grep -q 提前退出的窗口越大)。这正是它没在本地小规模测试里暴露的原因。
## 改法
检测存在性时用 `grep <pattern> >/dev/null`(读完整个输入再退出),
不用 `grep -q`。顺带补了 server 包的模型在位检测(原来只测了 full)。
This commit is contained in:
15
.github/workflows/release.yml
vendored
15
.github/workflows/release.yml
vendored
@ -243,13 +243,22 @@ jobs:
|
||||
echo " $f"
|
||||
dpkg-deb -f "$f" Package Version Architecture | sed 's/^/ /'
|
||||
done
|
||||
# full/server 必须真的带模型,否则是"默认启用但装完不能用"的假包
|
||||
# full/server 必须真的带模型,否则是“默认启用但装完不能用”的假包。
|
||||
#
|
||||
# ★ 不能用 grep -q:它匹配到就退出,关闭管道读端,dpkg-deb 内部
|
||||
# 的 tar 写 stdout 时收到 EPIPE(“stdout: write error”),
|
||||
# 在 pipefail 下整条 pipeline 变成失败 —— 检测项本身是好的,
|
||||
# 却被检测手段误杀(首次试发布就死在这里)。改用 >/dev/null,
|
||||
# grep 会读完整个输入再退出,不产生 SIGPIPE。
|
||||
dpkg-deb -c homeagent-full_*_amd64.deb \
|
||||
| grep -q "chinese-clip-vit-b16-onnx/TextEncoder.onnx"
|
||||
| grep "chinese-clip-vit-b16-onnx/TextEncoder.onnx" >/dev/null
|
||||
echo " ✓ full 包含模型"
|
||||
dpkg-deb -c homeagent-full_*_amd64.deb \
|
||||
| grep -q "libonnxruntime.so"
|
||||
| grep "libonnxruntime.so" >/dev/null
|
||||
echo " ✓ full 包含 ONNX Runtime"
|
||||
dpkg-deb -c homeagent-server_*_amd64.deb \
|
||||
| grep "chinese-clip-vit-b16-onnx/TextEncoder.onnx" >/dev/null
|
||||
echo " ✓ server 包含模型"
|
||||
sha256sum -c SHA256SUMS
|
||||
|
||||
- uses: actions/upload-artifact@v7
|
||||
|
||||
Reference in New Issue
Block a user