Skip to content

emrg: build-release 九次修复 — Windows 检测改文件系统探测(rant #13) - #377

Merged
argszero merged 1 commit into
masterfrom
feature/build-release-fixes9
Aug 4, 2026
Merged

emrg: build-release 九次修复 — Windows 检测改文件系统探测(rant #13)#377
argszero merged 1 commit into
masterfrom
feature/build-release-fixes9

Conversation

@argszero

@argszero argszero commented Aug 4, 2026

Copy link
Copy Markdown
Owner

修复 PR #376 的 Windows 检测缺陷:

问题:PR #376uname -s 检测 Windows(Git Bash 返回 MINGW64_NT-*,≠ windows),且 [ -f python-dist/bin/python3.13.exe ] 判断失败——uv standalone python 在 Windows 的布局是 python.exe/python3.13.exe 在 python-dist 根目录(无 bin/ 子目录)。导致 else 分支仍执行 ln -s(Git Bash 需管理员权限)→ 第 9 次 CI 实跑 Windows 失败:ln: failed to create symbolic link 'python'

修复:改为文件系统探测——ls python-dist/python3.13.exe python-dist/python.exe python-dist/bin/python3.13.exe python-dist/bin/python.exe,探测到 .exe 即走复制分支(覆盖根目录 + bin/ 双布局),探测为空(POSIX 布局 bin/python3.13)走软链分支。不依赖 uname,跨平台稳健。

验证

  • bash -n OK
  • 模拟 Windows 布局(根目录 .exe)→ 探测到 python-dist/python.exe → 复制分支 ✓
  • 模拟 POSIX 布局(bin/python3.13)→ 探测为空 → 软链分支 ✓
  • pytest 464 passed
  • import checks OK

背景:rant #13 Phase 4 发布期,build-release CI 4 平台打包。当前 3/4 平台已成功,仅 Windows build-runtime 软链步骤失败。

…(rant #13)

前次修复用 uname -s 检测 Windows 失败:Git Bash 返回 MINGW64_NT-*(≠ windows),
且 uv standalone python 的 python.exe/python3.13.exe 位于 python-dist 根目录(无 bin/),
导致 else 分支仍执行 ln -s(Git Bash 需管理员权限)而失败。

改用文件系统探测:ls python-dist 下 .exe(根 + bin/ 双位置),存在即复制分支。
POSIX 布局(bin/python3.13)探测为空 → 走软链分支。不依赖 uname,跨平台稳健。

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 20260805-0058

审查内容:build-runtime.sh Windows 检测从 uname -s(Git Bash 返回 MINGW64_NT-*)改为文件系统探测(.exe 根目录 + bin/ 双布局兜底)。

验证:bash -n OK;Windows/POSIX 双布局模拟探测正确;pytest 464 passed;import checks OK。修复根因准确(第 9 次 CI 实跑 ln 失败日志佐证)。

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 20260805-0059

第二次复核:diff 与上轮一致(build-runtime.sh 文件系统探测 .exe 双布局,POSIX 软链分支保留)。bash -n OK;本地 master HEAD 与 PR 分支一致。无新增问题。

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

✅ LGTM — cycle 20260805-0060

第三次复核:diff 稳定(build-runtime.sh 文件系统探测 .exe 双布局,POSIX 软链分支保留)。bash -n OK;本地分支与 PR 一致。3 个不同 cycle(0058/0059/0060)连续 LGTM,满足合并条件。

@argszero
argszero merged commit fb95b89 into master Aug 4, 2026
1 check passed
argszero added a commit that referenced this pull request Aug 4, 2026
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
argszero deleted the feature/build-release-fixes9 branch August 5, 2026 06:18
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.

1 participant