Skip to content

test(builtins): regenerate issue3185 help-listing grids for pwd [-LPW] (Refs #3918) - #3922

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/3918-pwd-help-entry-cells
Nov 19, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/3918-pwd-help-entry-cells

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

根因

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)

GNU 锚点

  • GNU 5.3.20 的 $SHORT_DOC 是 pwd [-LP](builtins/cd.def:436、builtins/builtins.c:68)。
  • oracle 实测(~/workspace/rubash-audit/build-gnu/bash-5.3/bash,5.3.20):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 测试)。

生成与验证

  • 生成器 ~/workspace/fix-3918/gen_expected_3918.py(由 [bug] unix process_console_size stub: help width ignores window size when COLUMNS unset #3330 的 gen_expected.py 改编,REPO 指向本车道树):渲染器先对 GNU 5.3.20 oracle 自身的 77 条输出(rubash 表去 env、pwd 回 [-LP])在 COLUMNS=80 与 120 下逐字节校验通过;再对落盘四格校验——除 pwd 行外零差异;重生成后四格与现表逐行一致(UTF8_80 第 21 行为 wdispcolumn 边界行,按原样保留)。
  • fail-first(渲染器层):修前渲染器输出与落盘四格恰差 pwd 行一处;修后零差。另有队长 census 的茎现红佐证。

验证状态: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 行头注;无产品代码改动,无文件删除。

…] (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
caomengxuan666 marked this pull request as ready for review November 19, 2026 01:24
@caomengxuan666
caomengxuan666 merged commit c0ddc71 into master Nov 19, 2026
9 of 12 checks passed
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。
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