Skip to content

fix(ci): 修复 Windows 路径身份与 macOS 原生回归环境 - #4

Merged
xyzane54 merged 3 commits into
XHToken:mainfrom
xyzane54:codex/wefto-executable-paths
Oct 21, 2026
Merged

xyzane54 merged 3 commits into
XHToken:mainfrom
xyzane54:codex/wefto-executable-paths

Conversation

@xyzane54

@xyzane54 xyzane54 commented Oct 21, 2026 •

Copy link
Copy Markdown

首次团队主干 Actions 暴露了原生平台的路径差异。此 PR 修复 Windows 服务启动身份校验,并校正 macOS 回归环境与平台能力预期。

  • Windows:OS 镜像查询可能保留 8.3 短路径,LaunchRecord 已存储长路径。共享比较处解析两侧的现存绝对路径;保留 PID 创建时间、实例认证、未知路径拒绝和不同硬链接安装路径的区分。新增真实短路径子进程启动回归。
  • macOS:在 CI 中先把系统临时目录解析为真实路径,再固定 TMPDIR / TMP / TEMP,避免 /var → /private/var 别名触发现有安全路径保护。产品的路径保护保持原有边界。
  • macOS 等未实现外部 PID 身份的平台:cleanup 测试验证明确拒绝跨进程操作并保留未知实例记录;Windows/Linux 继续执行真实子进程清理用例。未新增 macOS 后台服务或登录自启支持。
  • 更新服务设计说明和产品回归文档。完整构建、27 包 race/vet、Chromium/WebKit 检查均保留。

验证记录:

  • Windows 短路径启动用例在旧代码上失败,修复后通过;四个受影响包在 Windows 本机测试和 vet 通过。
  • 首次团队主干运行:Linux 完整通过(两种浏览器各 19 项、无跳过);Windows 在服务身份校验失败。
  • 第一轮修复分支检查:Windows 的服务/控制/验收包均通过 race,另发现下述共享文件读取失败;该候选已被更新后的修复取代。
  • macOS 诊断:明确复现 /var 路径保护和不支持外部 PID 控制的测试预期错误。修正后的诊断和三平台完整运行正在验证。
  • actionlint 1.7.12、gofmt 和 diff 检查通过。尚未结束或被取代的运行不计为通过。

另有未解决的 Windows 共享包问题:internal/filememo/TestReadWhileReplaced 在原生 race 下出现 961 次临时文件缺失,导致完整门禁失败。steady.Stat / ReadThere 的缺失重试窗口和 filememo.statFile 的 gone 标记可能参与触发,尚需受控时序复现;本机普通测试通过不能证明它已解决。完整日志和 summary 保存在第一轮修复分支运行的 Windows artifact 中。

团队仓库关闭了 Issues(创建失败,GitHub 返回 410),因此先在此说明中保留该问题、失败输出和运行链接。没有删除、跳过或忽略这个检查,也没有将该问题标为已解决。最终托管结果将在完成后更新。

Windows shared-file regression follow-up

原生 Windows 2025 x64、Go 1.26.8 的完整产品回归在共享包 internal/filememo 出现并发替换读取失败:

  • 运行:Wefto CI / Windows
  • 已测 PR head:a640225d336d59bb206db381cbae776d71e5b533(PR 合并候选由 Actions checkout)
  • 命令包含 go test -race -count=1 -p 1 -timeout 45m ./internal/filememo。
  • TestReadWhileReplaced 运行 5.01 秒,统计到 961 次缺失读取;日志包含 open .../logins.json: The system cannot find the file specified 和 GetFileAttributesEx ...。
  • 同一次运行中,修复后的 cmd/wefto、routerservice、routeracceptance、routercontrol 均通过 race。前一轮此包通过;本机普通测试单次通过,均不能证明这个并发问题已解决。

现有测试启动两个 goroutine 持续写临时文件并替换目标文件,同时调用 filememo.Read。代码检查发现 steady.Stat / ReadThere 对不存在状态仅进行 15 次约 1ms 的等待;filememo.statFile 在一次缺失后会把路径记入 gone,后续 stat 直接使用 os.Stat。这可能放大持续替换期间的缺失窗口;是否由重试窗口被连续替换占满、Windows 文件系统调度或其他条件触发,仍需确定性注入和原生 race 重复验证。

第二次失败:候选 68c86656 的 Windows job。同一测试运行 5.00 秒,统计到 16883 次缺失读取;steady.ReadThere 的 open 和后续 stat 均返回文件不存在。本次 internal/filememo 和 internal/steady 相对团队主干没有改动,失败发生在 race 阶段,后续 vet/Chromium/WebKit 被门禁阻断。Windows 完整回归当前仍失败。

后续应保留完整正文读取、真正删除/权限错误的失败行为,并用受控的替换/读取时序复现。不要用忽略失败、返回空账户或仅重复 CI 得到一次绿色来关闭此问题。完整失败日志与 summary 在两次运行的 Windows artifacts 中。

yzxu11 added 3 commits October 21, 2026 11:17
…ntity

The first native Windows CI race run failed service startup because the OS
reported a short 8.3 image path while LaunchRecord stored its resolved long
path. Resolve both absolute paths in the shared comparison used by startup,
status and process ownership checks. Missing paths remain unknown and a
separate hard-link path does not become the same installation. PID creation
stamps and authenticated instance checks are preserved.

Validation: the real Windows short-path child test failed against the old
code with service executable identity mismatch, then passed after the fix.
All four affected Windows package suites (routercontrol, routerservice,
routeracceptance and cmd/wefto) passed; native vet and gofmt/diff checks passed.
The complete three-platform hosted gate will run after this push. The original
team main run passed Linux; Windows failed as above and macOS is still running.

Signed-off-by: yzxu11 <[email protected]>
The macOS diagnostic run 39538246748 showed protected layouts rejecting the system /var symlink. Resolve the runner-owned temporary root once and pass its physical path to Node and Go tests. Keep the product path protections intact. actionlint 1.7.12 and git diff --check passed; native hosted validation follows this push.

Signed-off-by: yzxu11 <[email protected]>
…state

macOS has no external PID identity backend. Its native diagnostic correctly rejected cross-process control, while the common cleanup test expected a successful identity lookup. Exercise explicit refusal and an unchanged unknown instance record on unsupported platforms. Keep the real child cleanup cases on Windows and Linux. Windows cleanup regression and formatting/diff checks passed; the macOS diagnostic provides the before-fix failure and will validate the new branch.

Signed-off-by: yzxu11 <[email protected]>
@xyzane54 xyzane54 changed the title fix(service): 修复可执行文件路径别名导致的服务启动失败 fix(ci): 修复 Windows 路径身份与 macOS 原生回归环境 Oct 21, 2026
@xyzane54
xyzane54 merged commit f39efea into XHToken:main Oct 21, 2026
2 of 4 checks passed
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