Skip to content

fix(gate): restore run-gate.sh syntax — missing done, POSIX_MODE guard - #1594

Merged
caomengxuan666 merged 1 commit into
mainfrom
fix/1590-run-gate-syntax
Nov 12, 2026
Merged

caomengxuan666 merged 1 commit into
mainfrom
fix/1590-run-gate-syntax

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Summary

rust2/gate/run-gate.sh is a syntax error on master: bash -n fails with line 368: syntax error near unexpected token 'fi'. The gate script could not execute at all, and no workflow ever called it, so the defect lurked silently after #1589 was merged. This PR restores the four closers #1589's restore dropped and adds a bash -n parse check to CI so a future bad restore fails loudly.

Refs #1590

Changes

  • rust2/gate/run-gate.sh
    • Restores done closing the for side in rust cpp loop (line 368).
    • Restores the if [ "$POSIX_MODE" -eq 1 ]; then guard around the landing-leak check, with its closing fi (which had sat orphaned on master, now re-balanced). The guard is restored, not removed: the section is titled "(posix mode)", the deletion came in the same mangled hunk as the other three dropped closers with no evidence of deliberation, and the landfall concept (niubash#346) is posix-mode-specific.
    • Restores the two fi closers for if [ -n "$setup" ] and if [ -e "$cand" ].
    • Moves the MSYS_NO_PATHCONV=1 / PATH lines out of the leak-check while loop (where they could only pollute gate stdout and never reach a run.sh) into the per-side run.sh-writing block, as its first two lines — matching rust2/GATE-REPORT.md, which documents them as "exported inside both Windows-side run.sh scripts".
    • Proof of scope: git diff c2fa3db0 -- rust2/gate/run-gate.sh on the fixed tree shows only the +11 MSYS lines; everything else is byte-identical to the reviewed pre-recover wave4b: restore the eight command sources + shared childproc spawner lost in the #1577 merge #1589 version.
  • .github/workflows/build-winuxcmd.yml: new Check gate shell scripts parse step in the Windows job (right after Checkout) that runs bash -n rust2/gate/run-gate.sh.

Verification

  • bash -n rust2/gate/run-gate.sh: rc=0 on the fixed tree; rc=2 (line 368: syntax error near unexpected token 'fi') on master 6fc5ebf7; rc=0 on pre-recover wave4b: restore the eight command sources + shared childproc spawner lost in the #1577 merge #1589 base c2fa3db0 (control).
  • Generated run.sh content checked via a stubbed copy of the writing block: first two lines are export MSYS_NO_PATHCONV=1 and export PATH="$PATH:/d/winux/bin", then the command line.
  • bash rust2/gate/run-gate.sh --help: rc=0, prints GATE SUMMARY (0/0 cases — no --help.tsv table); the script executes end to end.
  • YAML validated (yaml.safe_load OK).
  • Full gate run not done here: it needs Windows binaries plus the WSL GNU side, unavailable on the Linux lane machine; the gate's CI legs and the review round cover execution.

本 PR 删除了什么

UNVERIFIED-BY-CAPTAIN

…d (winx#1590)

#1589's restore of the wave4b sources dropped four closers in
run_case(): the done closing the for side loop, the if
[ "$POSIX_MODE" -eq 1 ] guard around the landing-leak check, and
the fi closing if [ -n "$setup" ] and if [ -e "$cand" ]. The
script could not execute at all (bash -n: line 368 syntax error near
unexpected token 'fi'), and no workflow ever called it, so the defect
lurked on master.

The POSIX_MODE guard is restored, not removed: the section is titled
'(posix mode)', the deletion came in the same mangled hunk as the
other three dropped closers with no evidence of deliberation, and the
landfall concept (niubash#346) is posix-mode-specific.

The same hunk's new MSYS_NO_PATHCONV=1 / PATH lines were misplaced
inside the leak-check while loop, where they could only pollute gate
stdout and never reach run.sh. They are moved into the per-side run.sh
writing block, which is where they function: GATE-REPORT.md documents
them as 'exported inside both Windows-side run.sh scripts'.

Also adds a bash -n parse check for the script to the Windows CI job
so a future bad restore fails CI instead of silently shipping an
unrunnable gate.

Refs #1590
@caomengxuan666

Copy link
Copy Markdown
Member Author

复核结论:PASS

PR #1594(Refs #1590,头 1122e0b0)复核通过。#1589 卷宗 §9 的返工项 1 已全部落盘;#1591 面未碰,不在此判。

逐腿结果(复核员独立重跑,非车道自述)

  • diff 全读(2 文件):rust2/gate/run-gate.sh +15/−11,.github/workflows/build-winuxcmd.yml +9/−0。
    • 四处恢复(done / POSIX_MODE 守卫 / 两 fi)与 pre-recover wave4b: restore the eight command sources + shared childproc spawner lost in the #1577 merge #1589 c2fa3db0 对照:run-gate.sh 为 +11/−0——相对已审过的旧版只多 MSYS 块 11 行,零删除、零改动,四处恢复逐字节纯还原。base 6fc5ebf7 同区亲读确认四缺失逐一对应。
    • MSYS 两行从 leak-check while 循环内移到 per-side run.sh 写出块首两行,与 rust2/GATE-REPORT.md:579-583 明文("exported inside both Windows-side run.sh scripts")一致;旧位置每轮迭代只能污染 gate 自身 stdout,永远到不了 run.sh。
    • 新 CI 步 Check gate shell scripts parse 位于 build-windows job 的 Checkout 之后、Extract Version 之前;YAML 有效;该钉在四条 build-windows 腿的 steps 表中均为 completed/success(含 x64-default 腿)。
  • fail-first:git show 6fc5ebf7:rust2/gate/run-gate.sh | bash -n → rc=2,line 368: syntax error near unexpected token 'fi';对照 c2fa3db0 rc=0;修复后 rc=0。
  • 生成的 run.sh:stubbed 写出块复现,首两行确为 export MSYS_NO_PATHCONV=1 / export PATH="$PATH:/d/winux/bin"。
  • 冒烟:bash rust2/gate/run-gate.sh --help rc=0,打印 GATE SUMMARY(0/0),脚本端到端可执行。
  • blob 一致性:工作区修复文件 git hash-object 与 Git Data API 交付 blob 同值(run-gate.sh df9d8f3c…,workflow c793d608…);本地 diff --stat 与 compare API 一致(24+/11−)。
  • 正文:Refs #1590 一处;closing 词邻接 issue 号 = 0;「本 PR 删除了什么」节在;UNVERIFIED-BY-CAPTAIN 在。
  • 交集(队长已重算,复核员 §9 的「活尖仍 6fc5ebf」已过期):fix(timeout,nohup,nice): execvp-form child resolution for non-PE targets (#1587) #1588 已于 2026-11-12T18:06:08Z 合入(ebf6ad51),winx master 活尖现为 ebf6ad51。区间 6fc5ebf7..ebf6ad51 共 8 文件(childproc.rs / lib.rs / nice.rs / nohup.rs / timeout.rs / nohup.tsv / timeout.tsv / gen-cases.py),与本 PR 的 2 文件(run-gate.sh / build-winuxcmd.yml)交集 = ∅,程序化零交集证明成立,无需 update-branch,可直接按验证头合入。

终头 CI 全读(runs 43269903722 / 43269904040)

8 pass + 5 skipping + 1 fail:compare / baseline / baseline-growth / arm64 default / arm64 full / x64 full / i18n-drift / oracle 全部 pass;5 项 skipping;唯一红腿 build-windows (x64, default)(1h10m42s),红步仅 Run Unit Tests (ctest)。

红腿定性 base-red:头腿 ctest 失败 23 名;与基底 6fc5ebf7 的 master push 跑(run 43245017935)同腿失败名集做程序化集合比较——23 = 23,完全相等,零新名、零修复名。失败面为 head fifo issue1442 ×6(Timeout)、ln issue1367 ×2、mkfifo ×11、seq ×1、tac issue1368 ×1、stat ×2,与 #1588 卷宗所记 master 红面一致。c2fa3db0 跑只败 21 名是同一抖动族的不同采样。本 PR 未碰任何 Rust/C++/测试源码,无机制可致 ctest 回归。按 #1589 卷宗 §9「逐名对照 base-red 集」放行。

合入条件

@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 12, 2026 19:02
@caomengxuan666
caomengxuan666 merged commit c74112c into main Nov 12, 2026
13 of 14 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