emrg: build-release 十一次修复 — Windows python.exe 探测(rant #13) - #379
Conversation
第 11 次实跑:3/4 平台成功(macOS + ubuntu×2,pipefail 修复生效), Windows 失败于 build-runtime.sh 第 4 步 pip install:exit 127(command not found)。 根因:Git Bash 对带路径的直接执行不做 .exe 补全。Windows 复制产物为 bin/python.exe(bin/python 无扩展名文件不存在),而脚本用 `"$DIST/bin/python"` (无扩展名)调用 → bash 找不到文件 → 127。POSIX 有 python 软链所以正常。 (bin/emrg.cmd 早已用 "%DIR%\python.exe",验证了引用方式差异。) 修复:PY_BIN 探测——bin/python 不存在且 bin/python.exe 存在时改用 .exe。 用 -e(存在性)而非 -x(可执行),cp 复制的 exe 执行位在 Git Bash 中不可靠。 验证: - bash -n OK - Windows(仅 python.exe)/ POSIX(仅 python 软链)双场景模拟正确 - 本机 macOS 实跑 build-runtime.sh 完整成功(83M runtime,pip deps 安装 OK) - pytest 464 passed;import checks OK
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260805-0064
审查内容:build-runtime.sh PY_BIN 探测——bin/python 不存在且 bin/python.exe 存在时改用 .exe(Git Bash 带路径执行不做 .exe 补全 → 127)。
验证:bash -n OK;Windows/POSIX 双场景模拟正确;本机 macOS 实跑 build-runtime.sh 完整成功(83M + pip deps);pytest 464 passed。根因分析准确(第 11 次实跑 3/4 成功,仅 Windows pip 127)。
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260805-0065
第二次复核:diff 与上轮一致(build-runtime.sh PY_BIN 探测——python 不存在且 python.exe 存在时切 .exe,用 -e 存在性检查)。bash -n OK;本机实跑成功验证过。无新增问题。
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle 20260805-0066
第三次复核:diff 稳定(build-runtime.sh PY_BIN 探测——python 不存在且 python.exe 存在时切 .exe,-e 存在性检查)。bash -n OK;本机 macOS 实跑 build-runtime.sh 完整成功(83M runtime + pip deps)。3 个不同 cycle(0064/0065/0066)连续 LGTM,满足合并条件。
…380) 第 12 次实跑:3/4 平台成功,Windows 仍失败于 build-runtime.sh 第 4 步 pip install:exit 127(0.059s 即失败 = 命令未启动)。 根因:python-build-standalone Windows 版把 python313.dll 等 DLL 放在 python-dist/ 根目录。第 2 步把 python.exe 复制到 bin/ 后,DLL 不在 exe 目录也不在 PATH → Windows loader 找不到 DLL → 进程启动失败 → bash 报 127。 (PR #379 的 PY_BIN 探测已生效:bin/python.exe 存在,但 DLL 缺失。) 连带发现:bin/emrg.cmd 和 bin/emrgd.cmd 也用 bin/python.exe 复制品—— 发布后的 Windows 用户启动同样会失败。同源修复。 修复(3 文件): 1. build-runtime.sh 第 4 步:Windows 直接用 python-dist/ 根目录的 python.exe(与 DLL 同目录),POSIX 保持 bin/python 软链 2. bin/emrg.cmd:改用 %DIR%\python-dist\python.exe(不存在则回退 python3.13.exe) 3. bin/emrgd.cmd:同上 验证: - bash -n OK - Windows(python-dist 根 exe)/ POSIX(软链)双场景模拟正确 - 本机 macOS 实跑 build-runtime.sh 完整成功(83M runtime,pip deps OK) - pytest 464 passed;import checks OK
第 11 次实跑:3/4 平台成功(macOS + ubuntu×2,pipefail 修复生效),Windows 失败于 build-runtime.sh 第 4 步 pip install:exit 127(command not found)。
根因:Git Bash 对带路径的直接执行不做 .exe 补全。Windows 复制产物为 bin/python.exe(bin/python 无扩展名文件不存在),而脚本用
"$DIST/bin/python"(无扩展名)调用 → bash 找不到文件 → 127。POSIX 有 python 软链所以正常。(bin/emrg.cmd 早已用"%DIR%\\python.exe",印证引用方式差异。)修复:PY_BIN 探测——bin/python 不存在且 bin/python.exe 存在时改用 .exe。用
-e(存在性)而非-x(可执行),cp 复制的 exe 执行位在 Git Bash 中不可靠。验证:
背景:rant #13 Phase 4 发布期。合并后重打 tag 第 12 次实跑,预期 4/4 全绿 → Release 发布。