Repository navigation
test(builtins): regenerate issue3185 help-listing grids for pwd [-LPW] (Refs #3918) - #3922
Merged
Merged
Conversation
…] (Refs #3918) Root cause: HELP_ENTRIES carries the deliberate MSYS extension `pwd [-LPW]` (pwd -W landed in #3716, niubash#993 §6) but the four #3185 expected grids were generated when the entry still read GNU's `pwd [-LP]`, so issue3185_help_listing_column_major is red on the pwd row (row 12) on current master. Decision (option 2 of #3918): keep [-LPW]. -W is a real, implemented and tested option (src/builtins/pwd.rs Mode::Win32; tests/ niubash993_pwd_w.rs); the `help pwd` short_doc (src/builtins/ help_texts.rs:1332), the usage line (src/builtins/pwd.rs:123) and the issue2753/2791 nails already say [-LPW]. Reverting the listing entry to [-LP] would make bare `help` disagree with `help pwd` and `pwd -x`. GNU anchors: GNU 5.3.20 $SHORT_DOC is `pwd [-LP]` (builtins/cd.def:436, builtins/builtins.c:68); oracle `help` at COLUMNS=80/120 prints `pwd [-LP]` on the same row. The [-LPW] wording is a deliberate rubash extension of the same class as the extra `env` entry already documented in this test file. Regeneration: ~/workspace/fix-3918/gen_expected_3918.py (adapted from the #3330 generator). The renderer was re-validated byte-for- byte against the GNU 5.3.20 oracle's own 77-entry output at COLUMNS=80 and COLUMNS=120, and against the on-disk grids: the only diffs were the four pwd rows. Only those four rows change (UTF8_80 row 21, the wdispcolumn boundary, preserved as-is). UNVERIFIED-BY-CAPTAIN: no binary leg ran in this lane — the new server SSH link was down on three attempts (banner timeout via the egress proxy) and the X299 tunnel is down; base/fix tarballs are staged in ~/workspace/fix-3918/ for the captain's leg. 本 PR 删除了什么:无(仅重生成四张期望格的 pwd 行 + 5 行头注)。
caomengxuan666
marked this pull request as ready for review
November 19, 2026 01:24
This was referenced Nov 19, 2026
caomengxuan666
added a commit
that referenced
this pull request
Nov 19, 2026
…(Refs #3184) Refs #3184 ## 本 PR 做了什么 修复 #3184 在当前 master(622ee661)上复验后剩余的唯一分歧家族:`if` 构造(condition / then / elif / else 各段)内含算术命令时的语法错误归因。冻结观察中的其余形状(run-parser 的 esac/do、run-comsub-posix 回显、run-arith 的 `"+ "`、run-array 的 `<>`、x1 shopt 回显)在当前尖已逐字与 GNU 一致,本 PR 不动。 两处机制缺陷(GNU 锚:parse.y:6724 yyerror 于流序首个出错 token 触发;parse.y:6841 report_syntax_error): 1. **回退扫描误判折叠算术令牌**:`parse_if_command` 失败后 `if_frame_offender` 决定报 mismatched-closer 还是 EOF 形;它把词法器折叠的算术命令令牌(单个 Keyword 令牌、值即整个 `((…))`)当作非法 phase 关键字点名。未闭合 `if` 含 `((…))` 时误报 `syntax error near unexpected token '((1))'`,GNU 为 `syntax error: unexpected end of file from 'if' command on line 1`(parse.y:6899)。GNU 文法在凡可接受命令处接受 ARITH_CMD(parse.y:1203),扫描现按 phase 的命令处理折叠令牌。 2. **段内 latched error 被边界恢复失败丢弃**:condition / then / elif / else 段 Errored 且 `find_if_then` / `scan_if_section_end` 找不到边界时,已锁存的段内错误被丢弃、由回退层猜测另一 token。现改为恢复失败时直接返回 latched error:构造内参数位的 `((` 报 `(`(词法器在该位置返回裸 `(`——parse_dparen parse.y:4895 受 reserved_word_acceptable parse.y:4926 门控,参数位不通过),不再误报更早的 `((…))` 或 EOF 形。 ## 本 PR 删除了什么 无删除(纯增性修法 + 新回归钉文件)。 ## 验证 - 新钉 `tests/issue3184_if_arith_eof_attribution.rs`:14 缺陷格 + 7 对照格,期望全部与 GNU bash 5.3.20 脚本文件探针逐字对齐(服务器腿结果见车道 REPORT)。 - 探针矩阵(18 格冻结形 + 30 格变体)在修复二进制上与 oracle 全 SAME(修复前 15 格 DIFF)。 ## 队长复核(头 d1c65d1) - 头 CI census 72:自带钉 issue3184_if_arith_eof_attribution **21/21 全绿**,相对尖集新增仅 issue1902 抖动格;goldens 基线二名;CLI 唯一红 = 已裁定 coproc flake;Rust/macOS/cross/Windows/shell/ledger/niu 全绿。 - 服务器腿(车道跑、队长核 REPORT):base fail-first 恰 14 红 7 绿;探针 53 格修复后全 SAME(修复前 15 DIFF);lib 1280/0/4 与 base 名集对齐;-D warnings rc=0;三文件 rustfmt rc=0;相邻钉 issue3184_compound 7/7、issue3204 7/7。 - 未改任何既有钉;与现尖零交集已核(merge-base 以来仅 #3922 的测试文件合入),免 update-branch。合后手关 #3184;while/until 同族残差已另立 #3936。
caomengxuan666
added a commit
that referenced
this pull request
Nov 19, 2026
## 概要 统一仓内对 `pwd` usage 行的互斥断言。产品侧的 usage/short-doc 早已是 `pwd [-LPW]`(`-W` 为 niu #993 §6 的既定扩展,见 `src/builtins/pwd.rs:123`、`src/builtins/help_texts.rs:1332`、`src/builtins/help.rs:608`),且 PR #3922 已把 issue3185 期望网格对齐到 `[-LPW]`;但 issue705 与 issue3348 的四处钉仍断言 GNU 形状 `pwd [-LP]`,与产品现状及其余钉(issue2753 / issue2791 / niubash993 / part_021 / issue3185 / issue3330)互斥。本 PR 把这四处断言 rubash 自身输出的钉对齐到 `[-LPW]`。 Refs #3924 ## 改动(逐钉) | 文件:行 | 原断言 | 处置 | | --- | --- | --- | | tests/issue705_error_branding.rs:395 | `pwd: usage: pwd [-LP]`(rubash `-c "pwd -Q"` 的 stderr 全文断言) | 改 `[-LPW]` | | tests/issue3348_comsub_forged_pwd_logical_regressions.rs:255 | `stderr.contains("pwd: usage: pwd [-LP]")` | 改 `[-LPW]` | | tests/issue3348_comsub_forged_pwd_logical_regressions.rs:269 | 同上 | 改 `[-LPW]` | | tests/issue3348_comsub_forged_pwd_logical_regressions.rs:298 | `stdout.starts_with("pwd: pwd [-LP]\n")`(`pwd --help` 首行) | 改 `[-LPW]` | 四处均经上下文核读,断言对象均为 rubash 自身输出,无一为 GNU 对照期望。 ## 本 PR 删除了什么 无删除。纯测试断言对齐:2 文件、4 行字符串内容变更;`src/` 一行未动;`tests/gnu-compat/upstream-rights/builtins.right:358,452` 的 GNU oracle golden(`pwd [-LP]`,GNU 本尊输出)原样保留。 ## 验证 服务器腿在工作区 REPORT 中记录(base fail-first + 对齐后逐 stem 跑绿 + issue3185 对照)。 UNVERIFIED-BY-CAPTAIN ## 队长复核(头 f66fd22) - 头 CI census 68:相对尖集**零新增**;issue3348 茎 18/18 绿、issue705 断言格全绿;goldens 基线二名;CLI 唯一红 = 已裁定 coproc flake。 - 对齐面:仅四处断言(issue705:395、issue3348:255/269/298)由 `[-LP]` 改为 `[-LPW]`;GNU golden builtins.right:358,452 原样保留,文档注释不动。旧断言对现产品必然假(产品串 `pwd [-LPW]` 不含 `pwd [-LP]` 子串),fail-first 由字面量分析成立。 - 注:车道 REPORT 的「腿结果」节为空(服务器腿未落盘);复核证据取头 CI census 按名裁定(两茎逐格绿),与现尖零交集已核(merge-base 以来仅 #3934 合入 parser 面),免 update-branch。合后手关 #3924。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根因
issue3185_help_listing_column_major在现尖恒红(队长 census:0 PASS / 1 FAIL),红在四张期望格的pwd行(第 12 行)。HELP_ENTRIES里的表项现在是pwd [-LPW](src/builtins/help.rs:608),而四张期望格生成于表项还是[-LP]之时,未随-W落地而重生成。非 #3185 本身复发。抉择:保留
[-LPW](#3918 方案 2)-W是真实功能:src/builtins/pwd.rsMode::Win32(feat(builtins): pwd -W prints the win32 spelling of the physical cwd (Refs unixwin/niubash#993 §6) #3716,niubash#993 §6 的 MSYS conv-to-win32 显示形),有专属茎 tests/niubash993_pwd_w.rs。help pwd短档(src/builtins/help_texts.rs:1332)、usage 行(src/builtins/pwd.rs:123)与 issue2753/2791 钉早已是[-LPW];把表项改回[-LP]会让裸help与help pwd、pwd -x三处互不一致。pwd [-LPW]是有意偏离 GNU goldens 的 MSYS persona 取舍。GNU 锚点
pwd [-LP](builtins/cd.def:436、builtins/builtins.c:68)。LC_ALL=C COLUMNS=80/120 help的 pwd 行均为pwd [-LP];help pwd首行pwd: pwd [-LP]。[-LPW]是有意的 rubash 扩展,与本文件头注已载明的env额外条目同类。改动
仅 tests/issue3185_help_listing_column_major.rs(+9/−4):四张期望格的 pwd 行
[-LP]→[-LPW],另加 5 行头注说明取舍与生成器出处。未碰 #3919(#3330)的文件表(src/script_driver.rs、pty 宽度探针、issue3330 测试)。生成与验证
env、pwd 回[-LP])在 COLUMNS=80 与 120 下逐字节校验通过;再对落盘四格校验——除 pwd 行外零差异;重生成后四格与现表逐行一致(UTF8_80 第 21 行为 wdispcolumn 边界行,按原样保留)。验证状态:UNVERIFIED-BY-CAPTAIN
本车道未跑任何二进制腿:新服务器 SSH 三次均 banner 超时(经 egress 代理 198.19.0.1:3128,23:5x 三次);X299 反向隧道断;Simular box 钱包为空;本 VM 本地构建禁。base/fix 两份 tarball 已备在 ~/workspace/fix-3918/(rubash-3918-base.tgz / rubash-3918-fixed.tgz),待队长在恢复的路线上补跑:基底茎 fail-first + 修后茎 6/6 + lib 对齐。
本 PR 删除了什么
无。仅重生成四张期望格的 pwd 行与 5 行头注;无产品代码改动,无文件删除。