Skip to content

WIP: clear the main x64 baseline of 10 (xargs 7 + find/ln/env) - #1427

Merged
caomengxuan666 merged 6 commits into
mainfrom
fix/winx-baseline10-xargs
Oct 28, 2026
Merged

caomengxuan666 merged 6 commits into
mainfrom
fix/winx-baseline10-xargs

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

What

Clears the main x64 baseline of 10 (winx-x64 verdict: the red is main's own, not any PR's). First CI round on this branch: 7 xargs items Passed, failure set = exactly the remaining 3, zero new failures. This update adds the find/ln/env fixes, in the mandated order.

xargs (7) — one product fix + three oracle-backed test calibrations

4 interactive timeouts (product): read_confirmation() tried CONIN$ first (#1320, mirroring GNU's /dev/tty). A Windows process can own a console nobody attends — CI runners and test harnesses inherit one while every standard stream is a pipe — and ReadFile on it blocks forever; each -p test burned the full 120s ctest timeout twice per run. Fix: CONIN$ is used only when this process's own stdout or stderr is attached to a console; otherwise the answer comes from stdin, the convention cp/ln/rm and find -ok already use here. The loud EOF failure from #1320 is unchanged.

3 assertion failures (tests; product matches GNU at the old constants): -s 21→22 and -s 22→23 (GNU counts every argv entry len+1 — verified against local GNU findutils boundary sweeps — and -d retains the last item's trailing newline, so the constants were calibrated to the pre-#1323 ruler); the -t quoting test now feeds its single-quote item through -0 (in the default input syntax ' is a grouping quote that GNU strips, so the item could never contain one — GNU -t for the -0 feed prints echo "a'b", verified locally, and the product quoter was verified verbatim standalone). Every assertion unchanged.

find (1) — unsatisfiable assertion corrected

issue_1309_ls_... failed only at the substring check: the -ls line itself ends with the path, so GNU's own correct output contains ./a.txt\n as its tail (verified: GNU prints one 11-field line ending in ./a.txt; the test's newline-count and field assertions pass on the product's output). The assertion now checks the intended property — no line consists of the bare path alone. No product change; the #1309 suppression works.

ln (1) — product fix

After a y answer at the -i prompt, the run fell into the "no force, no backup, no interactive" File-exists branch — the cascade never recorded the prompt's approval — so the destination was never replaced (exit 1, link unchanged). The affirmative answer now routes through the same remove_existing path -f uses, as GNU does. Decline path unchanged.

env (1) — test environment defect

env resolves the wrapped command through PATH alone (deliberate GNU execvp parity in plan_child_launch), and the staged bin dir is not on the test process's PATH, so on the runner echo.exe resolved to Git's coreutils echo ("echo (GNU coreutils)...") — exit 0, wrong banner. env's #1303 option boundary is intact (sibling tests pass). The test now leads PATH with ProjectPaths::detect_bin_dir(), the arrangement childproc's identity-sensitive tests use. Assertions unchanged.

Accounting

Target: x64 ctest failure set vs main baseline 10 → 0, zero new failures anywhere. I18N review (per AGENTS.md): no user-visible text added or changed in any commit; no catalog update required.

The #1320 change (3b91856) made read_confirmation try CONIN$ first,
mirroring GNU's /dev/tty.  On Windows a process can own a console
nobody attends -- services, CI runners and test harnesses allocate or
inherit one while every standard stream is a pipe -- and ReadFile on
that console's input queue blocks forever.  That is what hangs the
four -p unit tests for the full 120s ctest timeout on the x64 CI leg:
the harness feeds answers through the stdin pipe, the product never
reads it.

Use CONIN$ only when this process's own stdout or stderr is attached
to a console (positive evidence a user is watching this terminal);
otherwise read the answer from stdin, the convention the cp/ln/rm and
find -ok prompts already use in this tree.  The loud EOF failure from
#1320 is unchanged: a stdin already consumed as the item source fails
the read at EOF and aborts with exit code 1 instead of silently
skipping every command.
xargs_max_chars_splits_batches (-s 21) and
xargs_delimiter_does_not_force_exit_if_exceeded (-s 22) were
calibrated to the pre-#1323 joined-string length.  #1387 moved the
product to GNU's accounting -- every argv entry counts len+1,
verified against local GNU findutils (echo three fits -s 11, fails
-s 10) -- under which 'three' alone is 22 and the -d tail item
'gamma\n' (the newline is retained in -d mode, as GNU retains it)
is 23.  At the old constants the GNU-faithful outcome is the
cannot-fit error the CI log shows, so the constants move by the same
one byte; every assertion is unchanged.
The second half of xargs_verbose_quotes_special_args_1322 fed the
input a'b' through the default parser and expected the -t rendering
"a'b".  In the default input syntax ' is a grouping quote: GNU
parses a'b' to the item ab (verified locally: GNU -t prints
'echo ab'), so no argument ever contains the quote and the #1322
double-quote rendering can never trigger.  Feed the item through
-0, the verbatim channel -- GNU -t prints 'echo "a'b"' for it --
keeping the assertion and its #1322 intent at full strength.
issue_1309_ls_suppresses_default_print_and_has_all_fields failed
only at the substring check: stdout must not contain './a.txt\n'.
But the -ls line itself ends with the path (find.cpp prints
ls fields + path_display + '\n'), so GNU's own correct output --
one line, 11 fields, ending in './a.txt' -- contains exactly that
substring as its tail; the newline-count and field assertions of
the same test all pass on the product's output.  The assertion as
written is unsatisfiable by any correct implementation.

Assert the intended property instead: no line consists of the bare
path alone, which together with the single-newline and 11-field
checks pins the leaked-default-print shape at the same strength.
No product change: the -ls suppression added for #1309 works.
issue1367_dangling_destination_interactive_prompts: the 'n' run
passed, but after a 'y' answer the run still exited 1 with the link
unchanged.  The destination-handling cascade never recorded the
prompt's approval: with no -b and no -f, an approved run fell into
the 'no force, no backup, no interactive' File exists branch.

Track the affirmative answer and route it through the same
remove_existing path -f uses, as GNU does (an interactive yes is a
removal approval).  Backup still takes precedence when -b is given;
the decline path is unchanged.
env_wrapped_command_version_is_not_intercepted asserted the child
is this package's echo, but never arranged for it to be: env
resolves the wrapped command through PATH alone (GNU execvp
semantics; plan_child_launch deliberately does not search the
application directory), and the staged bin dir is not on the test
process's PATH.  On the CI runner the name resolves to Git's
coreutils echo instead, whose banner reads 'echo (GNU
coreutils)...' -- exit 0, wrong banner, exactly the observed
failure.  env's own #1303 option boundary is intact (its sibling
tests pass); the test's environment was the defect.  Lead PATH with
ProjectPaths::detect_bin_dir(), the arrangement childproc's own
identity-sensitive tests use.  Assertions unchanged.
@caomengxuan666 caomengxuan666 changed the title WIP: xargs: fix the 7 baseline failures (console-gated -p answers + GNU-ruler test calibrations) WIP: clear the main x64 baseline of 10 (xargs 7 + find/ln/env) Oct 28, 2026
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 28, 2026 05:36
@caomengxuan666
caomengxuan666 merged commit 915eb62 into main Oct 28, 2026
9 of 10 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/winx-baseline10-xargs branch October 30, 2026 01:42
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