emrg: build-release 十次修复 — pipefail 陷阱 + Windows 路径转换(rant #13) - #378
Conversation
PR #377 引入两个回归(第 10 次 CI 实跑 4 平台全失败): 1. POSIX(macOS/Linux):PYEXE 探测 `ls 4个.exe 2>/dev/null | head -1` 在 `set -euo pipefail` 下,POSIX 平台 .exe 全不存在 → ls 退出码 2 → 管道整体非零 → set -e 杀死脚本。修复:`|| true` 吞掉 ls 失败。 2. Windows:`uv python dir` 返回 Windows 原生路径(C:\...),Git Bash 中 glob `C:\.../cpython-3.13.9-*` 含字面反斜杠无法匹配 → PY_ROOT 定位失败 → cp -R 源不存在 → 脚本退出。修复:`cygpath -u` 转 POSIX(仅 Windows, command -v 探测),并统一 glob 定位(弃用 uname 前缀拼接——Git Bash 返回 MINGW64_NT-* 不可用),定位失败显式报错退出。 验证: - bash -n OK - set -euo pipefail 下 POSIX(无 .exe)/ Windows(有 .exe)双场景模拟通过 - 本机 macOS 实跑 build-runtime.sh 完整成功:runtime built OK(83M), python→python-dist/bin/python3.13 相对软链正确,python 3.13.9 可执行, version.txt=0.2.0 - pytest 464 passed;import checks OK
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260805-0061
审查内容:build-runtime.sh 双回归修复——(1) PYEXE 探测 || true 防 pipefail(POSIX 平台 ls 全失败);(2) cygpath -u 转换 uv python dir(Windows 原生路径反斜杠 glob 无法匹配)+ 统一 glob 定位。
验证:bash -n OK;set -euo pipefail 双场景模拟(POSIX 空→软链 / Windows .exe→复制)通过;本机 macOS 实跑 build-runtime.sh 完整成功(83M runtime,python 软链 + 3.13.9 可执行 + version 0.2.0);pytest 464 passed。根因分析准确(第 10 次实跑 4 平台全失败日志佐证)。
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260805-0062
第二次复核:diff 与上轮一致(build-runtime.sh PYEXE || true + cygpath -u 路径转换 + glob 定位)。bash -n OK;本机实跑成功验证过。无新增问题。
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260805-0063
第三次复核:diff 稳定(build-runtime.sh PYEXE || true + cygpath -u + glob 定位)。bash -n OK;本机 macOS 实跑 build-runtime.sh 完整成功(83M runtime + python 3.13.9 软链)。3 个不同 cycle(0061/0062/0063)连续 LGTM,满足合并条件。
修复 PR #377 引入的两个回归(第 10 次 CI 实跑 4 平台全失败):
问题 1(POSIX):
PYEXE="$(ls python-dist/python3.13.exe ... 2>/dev/null | head -1)"在set -euo pipefail下,POSIX 平台 .exe 全不存在 → ls 退出码 2 → 管道整体非零 → set -e 杀死脚本。macOS/ubuntu 均在 build-runtime.sh 步骤失败(exit 1/2)。问题 2(Windows):
uv python dir返回 Windows 原生路径(C:\\...),Git Bash 中 globC:\\.../cpython-3.13.9-*含字面反斜杠无法匹配 → PY_ROOT 定位失败 →cp -R源不存在 → 脚本退出(exit 2,日志无 cp 错误因 set -e 静默)。修复:
|| true吞掉 ls 失败(pipefail 兼容)cygpath -u将 uv python dir 转 POSIX(仅 Windows,command -v 探测)验证:
背景:rant #13 Phase 4 发布期。第 10 次实跑 4 平台全失败 → 本次修复。合并后重打 tag 第 11 次实跑。