Repository navigation
fix(cmds): reject bare -h for csplit/pathchk/ptx (WinuxCmd#1591) - #1597
caomengxuan666 wants to merge 2 commits into
Conversation
复核结论:PASS(附 Owed-1 执行债,合入轮在 X299 上兑付)PR #1597(Refs #1591,头 逐腿结果(复核员独立重跑,非车道自述)
终头 CI 全读(runs 43283331302 / 43283331314)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)(1h1m55s),红步仅 红腿定性 base-red:头腿 ctest 失败 23 名;与基底 Owed-1:钉执行(合入轮在 X299 上兑付,不得冒充)三枚 Rust 单测 + 三枚 gate 行在任何地方均未执行过:全仓无 合入条件
|
|
队长关闭:superseded by merged #1593。 同一修复面、同一机制( #1593 的合入证据:X299 直接探针三命令 本 PR 自身的腿也已验证过(X299,2026-11-13 08:31–08:53 CST,STOP 前跑完,附录见卷宗):头单测 3/3 通过、基底 fail-first 0/3(断言点 panic);直接探针 rc=1、stderr 与 GNU 逐字节同;gate win-only 12/12,GNU-gated 0/81 皆 去留:三枚 Rust 单测 + 三枚 |
fix(ci): run cargo test in CI (Refs #1604) ## 根因 全仓没有任何 workflow 步骤运行 Rust 单测。`cargo test -p winux-cmds` 在树内存在且可跑(X299 实测 529 个单测),但 CI 从不跑它:x64-default 腿的 3840 个测试名全是 C++ gtest(ctest),Rust 单测 0 次。gate 行同样从不执行。后果是已验证的单测无 CI 守护——#1597 的三枚 `short_h_is_rejected_like_gnu` 单测在 X299 上已验证(头 3/3、基底 fail-first 0/3),但合入后未被吸收;吸收了也不会在 CI 跑,形同死代码。 ## 证据 - 全仓 3 个 workflow(`benchmark-speed-matrix.yml`、`build-winuxcmd.yml`、`gnu-master-differential.yml`)中无任何 `cargo test` 步骤;`build-windows` job 只在 x64 + default 腿跑 ctest。 - `build-windows` 已有 pinned Rust 工具链(`RUST2_TOOLCHAIN: "1.99.1"`)的 cache + 安装步骤,只是缺测试调用。 - `rust2/Cargo.lock` 与 workspace 同步,`--locked` 安全;suite 为 X299 已验证的 529 测。 ## 本 PR 做的事 在 `build-winuxcmd.yml` 中新增 `rust-tests` job(windows-2025,与 ctest 腿并列、失败名集单独裁断):checkout → cache pinned toolchain → rustup 安装 1.99.1 → cache cargo registry → `cargo test --locked --no-fail-fast -p winux-cmds`(`rust2/` 目录)。只跑 `-p winux-cmds` 这一已验证的集合;其余 crate 的 suite 待同样验证后再扩。 `run-gate.sh` 本次不接进 CI:它的 GNU 面要 WSL、CPP 面要 Debug 版 `build-vs/` 树,两者托管 runner 上都没有(详见 REPORT §3);现有的 `bash -n` 语法检查保留。 ## 本 PR 删除了什么 什么也没删除。纯新增一个 CI job;未动产品代码,未动其余 job(含 `release` 的 `needs:` 未改,是否让 release 门控 `rust-tests` 请复核时定)。#1597 的 3 枚单测 + 3 枚 doc bullet 本次不加回,待本步骤在 master 变绿后再另起 PR。 UNVERIFIED-BY-CAPTAIN
Re-add the 3 `short_h_is_rejected_like_gnu` unit tests (csplit/pathchk/ptx) and the 3 matching `//!` doc bullets that were held back when #1597 was closed as superseded by #1593. What was re-added - `rust2/crates/winux-cmds/src/csplit.rs`: 1 test + 1 doc bullet (2 `//!` lines) - `rust2/crates/winux-cmds/src/pathchk.rs`: 1 test + 1 doc bullet - `rust2/crates/winux-cmds/src/ptx.rs`: 1 test + 1 doc bullet - 42 insertions, 0 deletions, 3 files. No product-code change, no workflow change. Why now - The product fix (argopt `H_REJECT_SPEC` + `rejected_short_h`) already landed on master via #1593 (bb489e0); only the tests + doc bullets were missing. - PR #1605 (d2ee03f) put `cargo test -p winux-cmds` into CI (rust-tests job), so these tests will actually execute now. They were held back pending exactly that. Evidence (X299-2607, Windows) - Head (4bcbaf7): `cargo test -p winux-cmds short_h_is_rejected_like_gnu` -> `test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 577 filtered out` - Base fail-first (6fc5ebf + re-add patch topped up; pre-#1593 tree without the product fix): `test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 533 filtered out` - Fresh builds proven: distinct `Compiling winux-cmds` paths per tree, distinct test-binary sha256 (head 40cbdb41…, base 62197a84…). - `rustfmt --check` rc=0 on all three touched files (head + base). Notes - The gate TSV rows + gen-cases.py rows from the original #1591 commit were deliberately NOT re-added: they belong to run-gate.sh, which is not wired into CI. - #1597 itself stays closed (superseded); this PR only re-adds its tests/bullets. 本 PR 删除了什么 - Nothing was deleted. 42 insertions, 0 deletions. UNVERIFIED-BY-CAPTAIN
Refs #1591 (no Fixes — captain reviews first).
csplit, pathchk and ptx printed help with rc 0 for a bare
-h; GNU coreutils9.4 reports
invalid option -- 'h'with rc 1 for all three. None of thethree option tables defined short
h, so bare-hfell through argopt'sdefault
-h→--helpmapping. This wiresargopt::H_REJECT_SPECfor thethree commands (same idiom as shuf/nohup/groups/who), adds one unit test per
command asserting the GNU bytes, and adds one
strictTSV row per command(cs33/pk31/px29; both copies of each row list in gen-cases.py).
Verification run by the captain-side executor after the wall reopened
(probe battery round 6 ALL PASS, 18:32 UTC): real gen-cases.py emit is a
no-op diff,
--dup-checkfindings 4 / exit 1 identical to the HEADbaseline,
rustfmt --checkclean on the three files,cargo check -p winux-cmds --tests --target x86_64-pc-windows-msvcrc=0 (the three newunit tests + wiring compile for Windows). Linux-host
cargo test/cargo checkcannot execute on this tree: the lib test target fails tocompile on Linux identically on head and base (Windows-only test code in
stat/nice/nohup/test_cmd/timeout/who/winsys — pre-existing, verified by
stash comparison). Test execution (head pass + base fail-first) is for
the review round (CI/X299).
本 PR 删除了什么:无。本 PR 只增加代码与测试用例,未删除任何文件、命令、选项或公开接口。
UNVERIFIED-BY-CAPTAIN