Repository navigation
#1488 wiring wave6: md5sum sha1sum sha256sum sha512sum echo rev to the rust2 staticlib - #1620
Merged
Merged
Conversation
…ridge (#1488) Gate b surfaced it during the wave6 wiring: the wired digest family read FILE operands with a plain std::fs::File::open, so a `!<fifo>` marker returned the marker's 7 bytes as the digest and stranded the `tee <fifo>` writer in open_fifo_write forever (mkfifo.md5sum_hashes_writer_bytes failed at the 10 s rendezvous cap). open_operand() now routes markers through fs_win::is_winux_fifo_path + open_fifo_read — the paste.rs wiring precedent, the rust2 port of the 1.x file_io::open_binary_file marker branch the wave5 mkfifo cross-checks pin. rev.rs carries only the operand-literal comment (the b2sum_wildcard digest-family contract: the shell globs, the program does not — GNU digest.c / util-linux rev receive shell-expanded operands; the 1.x md5sum/rev bodies glob-expanded, a GNU deviation the port does not carry and the 1.x-pinned wildcard ctests drop in the wiring commits). cargo test digestsum 23/23, rev 15/15; fmt clean. Refs #1488
…the C++ bodies (#1488) Mechanical replacement per rust2/REPLACEMENT-RECIPE.md: each handler body is the stdin-shape election (no FILE operand, or a '-' operand -> run_command_with_stdin, the ABI v1 whole-buffer entry the digest family keeps this wave; everything else -> run_command pass-nothing) plus one call into rust2/crates/winux-cmds/src/digestsum.rs. The whole *_sum_pipeline namespace (BCrypt hash objects, the build_config conflict ladder, sum_check plumbing) is deleted per applet; the REGISTER_COMMAND metadata stays byte-identical (help/man still render from it). ctx.raw_args passes verbatim because GNU digest.c parses its own getopt run. Case-table flips (gen-cases.py digest_rows, one shared function): a18/a19 --help/--version become win rows — the wired product's dispatcher intercepts them with the WinuxCmd-branded metadata text, so the GNU bytes leave the gate; the driver-era rows that gated them were green pre-wiring (ledger 2026-11-14). Three gates (build-vs exe vs the pre-wiring baseline exe vs WSL coreutils 9.4): - gate a+c harness: 4x33 case tables, 124 strict/exit rows GREEN, 8 win rows GREEN (RUST_BIN=the wired product, CPP_BIN=the baseline copy). - gate c stderr matrix (target/issue-suites/results/wave6-wiring/ matrix.sh, 26 digest rows per program, rc+stdout+stderr): byte-equal old-vs-new except the empty-operand quoting (md5sum: '': ... — the GNU quotef shape; the 1.x exe printed the name unquoted), 22/26 rows byte-equal per applet incl. the full --check machinery (OK/FAILED/ bad length/warn garbage/--quiet/--status/--tag conflicts). - gate b: ctest md5sum/sha1sum/sha256sum/sha512sum slices green; the 1.x-pinned wildcard rows (md5sum.md5sum_wildcard, sha512sum.sha512sum_wildcard, integration.md5sum_wildcard_pipe_sort) move to the literal-operand GNU contract of the already-wired b2sum_wildcard pin (the shell globs, the program does not). Refs #1488
Mechanical replacement per rust2/REPLACEMENT-RECIPE.md: the handler is the stdin-shape election (rev reads fd 0 ONLY with no FILE operand — util-linux opens '-' literally, never as stdin — hence run_command_with_stdin there, run_command pass-nothing everywhere else) plus one call into rust2/crates/winux-cmds/src/rev.rs (the util-linux rev 2.39.3 model: -0/--zero, locale-driven byte/UTF-8 reversal units, GNU-shaped option diagnostics). The 1.x helpers (utf8_unit_length, reverse_record_body, process_stream, expand_file_operands glob) are deleted; REGISTER_COMMAND metadata stays byte-identical. rev joins the permissive-unknown-shorts option policy (command_context.cppm): util-linux owns -h/--help and -V/--version that the metadata does not spell, so 'rev -h' reaches the wired body instead of dying as a C++ "invalid option" parse error — rv14 flips from the 1.x rc 1 to the GNU rc 0 util-linux help (ledger r=c:no records it). Case-table flips (gen-cases.py): sole/first --help/--version LONG tokens go through the dispatcher's WinuxCmd-branded interception, so rv13/15/18 become win rows; rv14/rv16/rv17 stay strict — the permissive-shorts policy classifies the short spellings as operands, the body prints the probed util-linux bytes (GNU-exact, ledger r=g:yes). rev_unit_test moves to the probed locale model: whole-UTF-8-unit reversal needs an explicit multibyte locale (LC_ALL=C.UTF-8), the effective locale with none of LC_ALL/LC_CTYPE/LANG set is C (setlocale fall-back, probed GNU rev 2.39.3) and reverses bytes — the 1.x body always reversed UTF-8 units, a GNU deviation the port replaced. Three gates (build-vs exe vs the pre-wiring baseline exe vs WSL util-linux 2.39.3): - gate a+c harness: 25 case tables, 19 strict rows GREEN + 4 win rows GREEN (rv14/rv16/rv17 strict rows byte-match GNU; rv14's r=c:no is the recorded 1.x parse-error deviation). - gate c stderr matrix (19 rev rows, rc+stdout+stderr): byte-equal old-vs-new except -h/-V/-V-extra (GNU util-linux text vs the 1.x parse error / WinuxCmd version block). - gate b: ctest rev slice green (locale-model + literal-operand contract updates above; rev_wildcard_file_operands_stay_literal follows the b2sum_wildcard digest-family pin). Refs #1488
Mechanical replacement per rust2/REPLACEMENT-RECIPE.md: the handler is
one winux::rust2::run_command("echo", ctx.raw_args) call into
rust2/crates/winux-cmds/src/echo.rs (coreutils src/echo.c's hand-rolled
leading-[-neE]-only flag scan, the POSIXLY_CORRECT allow_options rule
(argv[1] == "-n" exact match), the sole --help/--version rule and the
measured escape table). The whole echo_pipeline namespace (escape mode
election, build_text, process_escapes, the -u/--upper and -r/--repeat
extensions) is deleted; REGISTER_COMMAND metadata stays byte-identical
(help/man still render from it; the extension spellings remain listed
for help-surface continuity but retire with the body — GNU echo treats
them as data and the rust2 port is GNU-exact).
echo.c never calls getopt, so the dispatcher plumbing built around the
1.x body retires with it (dispatcher.cppm / command_context.cppm):
- the rewrite hook that guarded data-looking tokens behind a "--" is
gone — it exists to feed the generic parser, which would otherwise
print the guard as data through the GNU-exact scanner;
- echo's --help/--version interception narrows to the sole-argument
rule the library implements (echo.c honors them only as the sole
argument: 'echo -n --version' prints "--version", 'echo --help x'
prints "--help x" as data), still gated by the POSIX literal-mode
check (POSIXLY_CORRECT=1 echo --help prints "--help");
- the generic parser turns permissive for echo (allow_long_options off,
unknown shorts as positionals): no echo argv is rejected ahead of the
body, and the declared -n/-e/-E still parse for occurrence
bookkeeping the handler never reads.
echo never reads stdin: the pass-nothing run_command contract keeps fd 0
live for pipeline consumers.
Case-table flips (gen-cases.py): sole --help/--version become win rows
(dispatcher interception prints the WinuxCmd-branded metadata text; the
POSIX-literal help/version rows stay strict — interception is disabled
there and the GNU bytes flow). echo_unit_test moves the retired
-u/--upper and -r/--repeat extension pins to their GNU data forms.
Three gates (build-vs exe vs the pre-wiring baseline exe vs WSL
coreutils 9.4):
- gate a+c harness: 40 case tables, 38 strict rows GREEN + 2 win rows
GREEN (RUST_BIN=the wired product, CPP_BIN=the baseline copy); every
escape/flag/POSIX row byte-matches GNU through the product dispatcher.
- gate c stderr matrix (34 echo rows, rc+stdout+stderr): byte-equal
old-vs-new except the retired -u/--upper/-r extension rows, where the
new exe prints the GNU data form.
- gate b: ctest echo slice green (the two extension pins updated above).
Refs #1488
md5sum sha1sum sha256sum sha512sum echo rev wired; three-gate numbers (run-gate product-mode 184 GNU-gated + 13 win GREEN; byte matrix 147/157 old-vs-new with the 10 GNU-moving rows explained; ctest failing set == the pre-wiring baseline), the digest v1-stdin decision, the echo dispatcher-plumbing retirement and the deferred streaming-stdin swap recorded. Refs #1488
The 17 new zh-CN extra legacy keys are exactly the deleted 1.x strings of the replaced bodies (verified by hash): the md5sum-family conflict ladder and BCrypt helper errors, the four digest Try-help lines, rev's stdin-error wording and echo's repeat-range validation. The GNU wording the replacements produce lives on the rust2 side, outside the C++ legacy extraction, so the catalog keys became extra. Recorded in the same PR per the gate contract; baseline commit ffcbe99 passes clean (181 items), this branch records 198.
Member
Author
|
i18n-drift lane: the 17 new zh-CN extra legacy keys are hash-verified as exactly the deleted 1.x strings of the replaced bodies (md5sum-family conflict ladder + BCrypt helper errors, the four digest Try-help lines, rev's stdin-error wording, echo's repeat-range validation) — the GNU wording the replacements produce lives on the rust2 side, outside the C++ legacy extraction. Baseline commit ffcbe99 passes clean (181 items), this branch records 198 via the sanctioned |
#1488) The commit-split dance restored the wired C++ bodies but missed three updated test files, so the digest/echo wiring commits still carried the 1.x glob-expansion pins for md5sum/sha512sum/integration while the product already treats wildcard operands as literal (the b2sum_wildcard digest-family pin) — the x64-default CI ctest leg caught the mismatch (the local gate-b run had the updated files in the working tree). Restores the three files from the verified working-tree state: the wildcard rows pin the GNU literal-operand ENOENT and rc 1, and the integration pipeline carries sort's rc 0 with the md5sum diagnostic on stderr. Refs #1488
This was referenced Nov 14, 2026
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.
#1488 mechanical replacement — wiring wave6
6 commands wired to the rust2 staticlib, C++ bodies deleted (one commit per family/command per the wiring discipline):
-h/-Vnow GNU byte-exactThree gates (recipe §3)
run-gate.sh— 184 GNU-gated rows + 13 win rows, 197/197 GREEN (RUST_BIN = the wired build-vs exe, CPP_BIN = the pre-wiring baseline exe copy, GNU = WSL coreutils 9.4 / util-linux 2.39.3). Help/version shapes the dispatcher intercepts with the WinuxCmd-branded metadata flipped towinin gen-cases.py; rev-h/-Vstayed strict (permissive-shorts policy classifies them as operands, the body prints the probed util-linux bytes).rust2-stream-*Not Run lanes; 24 = 24, zero new failures). Total tests 3862 -> 3863 (+1: the newrev_c_locale_reverses_byteslocale-model pin).target/issue-suites/results/wave6-wiring/matrix.sh— 157 rows (26 per digest applet incl. the full--checkmachinery, 34 echo incl. the -e/-n/-E escape matrix + POSIX modes, 19 rev incl. single/multi-file, dash operand, locales), rc+stdout+stderr compared: 147/157 byte-equal; the 10 differing rows all move to GNU (4x digest empty-operand quotef quoting, 3x echo retired-u/--upper/-r/--repeatextensions printed as data, 3x rev-h/-Vutil-linux text vs the 1.x parse error / WinuxCmd version block). GNU rc parity 156/157 — the one miss (echo -r x) is a declared-retired-extension corner where the old exe returned the same rc 1.Design notes (dispatcher plumbing retired with the 1.x echo body)
--is deleted (it fed the generic parser; the GNU-exact Rust scanner would print the guard), help/version interception narrows to the sole-argument rule (echo.c argc == 2), and echo's option policy turns permissive (no echo argv rejected ahead of the body).-h/-Vreach the util-linux-shaped body; rv14 fixes a 1.x rc-1 parse-error deviation).-operand, detected by the registration like fold's.b2sum_wildcarddigest-family pin (the shell globs, the program does not); the 1.x glob-expanding ctests moved to that contract.!<fifo>named-pipe bridge on reads (paste.rs precedent) — the ctest-net-caught component fix that motivated commit 1.Known notes / deferred
--helprows in their tables — a product-mode gate run for those commands would need the same win flip (noted in GATE-REPORT.md, not touched here).Refs #1488