Skip to content

rust2(ls): GNU coreutils 9.4 ls library port — 5287-line port + 146-row gate (#1488) - #1762

Merged
caomengxuan666 merged 3 commits into
mainfrom
rust2/ls-impl-devin
Nov 15, 2026
Merged

caomengxuan666 merged 3 commits into
mainfrom
rust2/ls-impl-devin

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Residual rescue of the timed-out ls-impl lane (D3 report: devin-out-D3.md), rebased onto current main.

Scope: ls.rs — GNU coreutils 9.4 ls.c library port in the explicit-IO form (reparse SYMLINK/MOUNT_POINT/LX tags, junction identity, FSCTL_GET_REPARSE_POINT targets, synthesized permission strings, no exec bit per the 1.x Windows value model); glob.rs fnmatch fix (* matches the empty name, refuses a leading dot); lib.rs registry entry; gen-cases ls_rows (146-row gate table); catalog/ i18n patch set (en extract 3640 keys, zh patch 21 keys).

Verification: cargo build clean; cargo test ls 19/0; rebase carried main's messages module (batch-2) with the usage_error Ctx migration.

Known-open: the timed-out lane's gate ledger numbers need re-attestation on CI; i18n-drift may list the 21 ls keys until the catalog companion lands (captain sequences).

…ow gate + i18n patch set (#1488)

Residual rescue: the ls-impl lane timed out mid-flight leaving the
whole port uncommitted. This commit lands it as-found plus the
missing catalog/ patch set the lane required:

- ls.rs: GNU coreutils 9.4 ls.c library port (explicit-IO form,
  CMake-injected via the lib.rs registry entry)
- glob.rs one-line fix: fnmatch '*' matches the empty name while
  still refusing a leading '.'
- gen-cases.py ls_rows: 146-row gate table (append-only)
- catalog/: en-US extract (3640 keys), zh-CN patch (21 keys),
  delta + validate artifacts, README-LS

D3 verification: cargo build clean; cargo test ls 14/0. The mv twin
report is devin-out-D3.md; gate numbers from the timed-out lane's
ledger remain to be re-attested on CI.
The port was authored before #1683 changed usage_error to
(ctx, io, cmd, msg) for the shared getopt/usage_error I18N surface.
interpret() already holds ctx — pass it through.

Also carries the union-rebase resolutions (lib.rs keeps main's
messages module + the ls module; gen-cases keeps both row sets).
…artifacts

Exit-mode rows otherwise leave no trace of WHY an rc differed — the
fs-dirs mk16-p-dir failure (rust rc 1 on the runner, rc 0 locally and
on GNU) is un-diagnosable from CI alone. Failed rows' rust stderr now
lands in rust-failed-stderr.txt next to the ledger in every shard
artifact; the run-gate.sh local runs get the same file in
$GATE_ARTIFACT_DIR.
@caomengxuan666
caomengxuan666 merged commit 3025942 into main Nov 15, 2026
21 of 28 checks passed
aphrody-dev pushed a commit to aphrody-labs/WinuxCmd that referenced this pull request Nov 20, 2026
Retire the 1.x ls pipeline: src/commands/ls.cpp keeps only the
REGISTER_COMMAND metadata (help/man/completion) and hands ctx.raw_args to
winux::rust2::run_command_with_stdin_streaming("ls"). The library is the
already-landed 3025942 (unixwin#1762) 5287-line GNU coreutils 9.4 port.

CMake: append ls to WINUXCMD_RUST2_COMMANDS (union; the OFF filter then
drops the source with the rest of the replaced surface).

Bridge: ls keeps GNU's close_stdout status 2 for the closed-fd shape
(ls.c:1661, unixwin#1368). The generic drain answered 1 and would have reddened
ls.issue1368_closed_stdout_reports_write_error_and_exits_2.

Evidence: gate ls 146 rows GNU-gated 118 PASS / 0 FAIL + 28 win PASS
(baseline and post-wire runs identical); cargo driver build clean.

Known reds (library gaps, reported not fixed): 35 ls.* ctests that pin the
1.x Windows value model no longer hold, e.g. permission synthesis
(-rwxrwxrwx vs -rw-r--r--), junction size, .exe 755, internal wildcard
expansion (the 2.0 shell-glob retirement), --dired non-long trailer,
POSIXLY_CORRECT scanning, and GNU quote/colon wording in --width/--sort/
--time-style/--hyperlink diagnostics.
aphrody-dev pushed a commit to aphrody-labs/WinuxCmd that referenced this pull request Nov 20, 2026
The inventory still called six commands c++-only after their rust2
library/wire landed. Rows now say state=wired, status=rust2-wired,
engine=rust2, with commit evidence in the anchor:

- ls:   unixwin#1762 library 3025942; f87be22 wire (this branch)
- rm:   unixwin#1751 library 38e6835; f14bc60 wire (this branch)
- find: unixwin#1634 library; 792c31f (unixwin#1696 wire); unixwin#1633/unixwin#1658 help/version
- grep: unixwin#1660 library; 0eb0d28 (unixwin#1660 wire); -P face stayed on the C++
        PCRE2 path per DOCS/2.0-regex-engine-decision.md
- mv:   unixwin#1649; a0cfcd7 (unixwin#1773 reland that wired the 1.x retirement)
- sed:  unixwin#1635 library; f36f306 (unixwin#1690 wire)

No code changes; loc/oracle/test columns are historical measurements and
stay as recorded.
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