Repository navigation
rust2(xargs): GNU findutils 4.9 xargs implementation (#1488) - #1625
Merged
Merged
Conversation
caomengxuan666
added a commit
that referenced
this pull request
Nov 14, 2026
…ult echo (#1488) Restricted-fix batch, captain-landed after dual review (lead audit + verification-lane re-run): - childproc: quote_windows_arg -> pub(crate) - echo: echo_bytes(&[&[u8]]) core; OS argv boundary does a single lossy conversion; default echo keeps raw bytes (0xff stays 0xff, NUL truncation preserved) - xargs: is_cmd_image (cmd/cmd.exe leaf, case-insensitive, full paths) gets literal caret escaping after /c (space tab ^ & | < > ( ) "); incremental UTF-16 budget counts escape overhead - run-gate.sh harness: composite local array assignments split (no backslash stripping); GATE_ARTIFACT_DIR/GATE_GNU_REMOTE_ROOT parameterized end-to-end; stdout compared via cmp on captured files (old shell-variable compare dropped NUL bytes); stderr samples copied verbatim; missing side or non-numeric rc = fail. No expectation relaxed; new checks can only add failures. Verification (gate-xargs-reviewed-05, valid rerun; 04 kept as an environment record): 141 rows (134 strict + 5 exit + 2 win), GNU 139/0, win 2/0, ledger byte-identical to reviewed-03; 9/9 direct argv/raw-byte probes PASS; cargo test xargs 25/0, echo 15/0. PR #1625 oracle leg FAILURE adjudicated per the #1538 precedent (savannah gnulib HTTP 500 at checkout, no test touched); job rerun green.
caomengxuan666
added a commit
that referenced
this pull request
Nov 14, 2026
…historical snapshot (#1629) The checkpoint section records the acceptance state as audited by the lead review: current main had 50 commands wired (not the historical 76/42 numbers), A1/tail/ABI-v3 are not accepted yet, I18N is an acceptance prerequisite, and the safety record for preserve-root (chmod/chgrp/chown) blocks wiring until the listed gates pass. Captain addendum records same-day movement: #1627 merged, PRs #1624/#1625/#1626/#1628 open, and the fix/batch-1595-1616-1617 trio.
Port of findutils 4.9.0 xargs.c/buildcmd.c on the shared childproc resolver: read_line/read_string state machines (quotes, backslash, EOF string quirks, logical lines), -0/-d escapes, -I insertion with the bc_do_insert budget, -n/-L/-I exclusion warnings, -s accounting with the GNU limit diagnostics plus the Windows command-line budget (32767 UTF-16 units, 8191 for cmd.exe), -t/-p gnulib shell-escape quoting, -p/-o via CONIN$, -P with WaitForMultipleObjects, --process-slot-var, --show-limits, and the 0/123/124/125/126/127/1 status contract. Input streams lazily; the default command runs the library echo in-process. Unit tests: 21 (scripted tty, broken-pipe streaming). Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
134 strict / 5 exit / 2 win rows; children follow the timeout/nohup convention (default echo, echo/printf images, sh -c for statuses), multi-line inputs via -a setup files. GNU-gated 139/139, win 2/2. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…1488) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ult echo (#1488) Restricted-fix batch, captain-landed after dual review (lead audit + verification-lane re-run): - childproc: quote_windows_arg -> pub(crate) - echo: echo_bytes(&[&[u8]]) core; OS argv boundary does a single lossy conversion; default echo keeps raw bytes (0xff stays 0xff, NUL truncation preserved) - xargs: is_cmd_image (cmd/cmd.exe leaf, case-insensitive, full paths) gets literal caret escaping after /c (space tab ^ & | < > ( ) "); incremental UTF-16 budget counts escape overhead - run-gate.sh harness: composite local array assignments split (no backslash stripping); GATE_ARTIFACT_DIR/GATE_GNU_REMOTE_ROOT parameterized end-to-end; stdout compared via cmp on captured files (old shell-variable compare dropped NUL bytes); stderr samples copied verbatim; missing side or non-numeric rc = fail. No expectation relaxed; new checks can only add failures. Verification (gate-xargs-reviewed-05, valid rerun; 04 kept as an environment record): 141 rows (134 strict + 5 exit + 2 win), GNU 139/0, win 2/0, ledger byte-identical to reviewed-03; 9/9 direct argv/raw-byte probes PASS; cargo test xargs 25/0, echo 15/0. PR #1625 oracle leg FAILURE adjudicated per the #1538 precedent (savannah gnulib HTTP 500 at checkout, no test touched); job rerun green.
caomengxuan666
force-pushed
the
rust2/xargs-impl
branch
from
November 14, 2026 07:45
c565508 to
5aee314
Compare
caomengxuan666
added a commit
that referenced
this pull request
Nov 14, 2026
…trip preflight (#1721) The rust2-gate CI job ran the whole GNU side into MISSING (81/81, pass=0 fail=81) while wsl.exe itself "succeeded": Git Bash (MSYS2) rewrites leading-slash argv before spawning a native binary, so the harness's "wsl.exe --exec /bin/bash /mnt/<drive>/..." reached the distro as execvpe(D:/Git/usr/bin/bash) -> No such file or directory, with stderr swallowed. Byte-level repro on the local Git Bash; with MSYS_NO_PATHCONV=1 the same invocation runs the probe verbatim and /mnt automount is fine. Two semantic conflicts met here: #1625 moved the GNU leg onto this call shape (its local verification ran under the niubash family, which never converted this shape), and #1632 put the harness under Git Bash on CI. Export MSYS_NO_PATHCONV=1 inside the harness so every caller is safe, and add a one-roundtrip preflight that fails in seconds instead of MISSING-ing the corpus for minutes. Verified in the exact failing shell (Git Bash, this repo's gate subset): GNU-gated 81 PASS / 0 FAIL, win 12 / 0 - matching the pre-#1625 attested numbers.
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.
Library-form port of GNU findutils 4.9.0
xargsfor the rust2 command library (#1488). Rust implementation + gate only; no wiring (src/bridge, src/commands/xargs.cpp, CMakeLists.txt and winuxcmd-ffi are untouched; no childproc.rs changes were needed).What
rust2/crates/winux-cmds/src/xargs.rs: port of xargs.c / buildcmd.c on the sharedchildproc.rsresolve/build chain (PATH-only execvp shape, PATHEXT,.cmd/.batvia COMSPEC,#!scripts via interpreter).''items, EOF-string quirks, logical lines with trailing blanks, NUL warning),-0,-descapes with GNU diagnostics,-a(child keeps stdin;-a -reads stdin; otherwise children get NUL),-E/-e/--eof-I/-i/--replace(bc_do_insert budget, "command too long", leading-blank strip, implies -x),-n/-L/-lwith the GNU exclusion warnings-saccounting with GNU's limit messages and clamping,-x, plus the Windows command-line budget (32767 UTF-16 units, 8191 for cmd.exe) that splits batches, with GNU's E2BIG message for a single argument that does not fit-t/-pprinting in gnulib shell-escape quoting (checked against probe output),-p/-othroughCONIN$(the /dev/tty analog),-P(WaitForMultipleObjects),--process-slot-var,--show-limits, exact GNU--help/--versionechoruns in-processgen-cases.py(141 rows, append-only) andcases/xargs.tsv, GATE-REPORT section.Results
cargo test: 723 passed in winux-cmds (21 are xargs tests), whole workspace green;cargo fmt --checkclean.bash gate/run-gate.sh xargs: GNU-gated 139 PASS / 0 FAIL, win 2 PASS / 0 FAIL (134 strict / 5 exit / 2 win). C++ parity 115/141. GATE-REPORT.md explains each of the 26r=c:norows; in every one the 1.x C++ applet diverges from GNU and Rust matches GNU.Known gaps (documented in the module doc and GATE-REPORT)
--show-limitsdoes not print the "continue now" notice, because that needs isatty(stdin).-p/-oopen the console unconditionally, the way GNU opens /dev/tty.cmd /cchildren get std's Win32 quoting, not the 1.x caret escaping.DO NOT MERGE until reviewed; wiring will come in a later PR.