Skip to content

chore: sync uutils/coreutils argument surfaces and vendored modules - #3025

Merged
chaliy merged 1 commit into
mainfrom
chore/coreutils-args-drift
Nov 30, 2026
Merged

chaliy merged 1 commit into
mainfrom
chore/coreutils-args-drift

Conversation

@chaliy

@chaliy chaliy commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Automated regeneration of argument surfaces and vendored modules
ported from uutils/coreutils.

Source revision: 2a072db29 (was 8b16a3dca)
Utilities: cat ls mktemp od readlink realpath shuf stat tac tee truncate
Vendored modules: format
Trigger: .github/workflows/coreutils-args-drift.yml

This PR bumps UUTILS_REVISION in
crates/bashkit/src/builtins/generated/mod.rs, the matching
<util>_args.rs files, and any vendored module trees
atomically — args codegen, module-vendor mode, and the
body-drift harness all stay aligned to the same rev.

Review the diff to confirm whether upstream:

  • Added flags we should now expose
  • Removed/renamed flags we should drop or migrate
  • Reworded help text in user-visible ways
  • Changed body code in vendored modules (e.g. format/)

Squash-merge as a human so the merge commit is attributed
correctly per AGENTS.md. Intermediate bot commits in this PR
are discarded by squash.

Design: knowledge/runtimes/coreutils-args-port.md.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

… modules

Regenerated by `bashkit-coreutils-port` against uutils/coreutils@2a072db29.

Utilities: cat ls mktemp od readlink realpath shuf stat tac tee truncate

Vendored modules: format
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
bashkit 41c877c Commit Preview URL

Branch Preview URL
Nov 30 2026, 05:09 AM

@bashkit-pr-reviewer bashkit-pr-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated uutils sync review: 18 of 20 files are header-only rev bumps consistent with the new UUTILS_REVISION; the single functional hunk is a faithful port of upstream's new flag precedence. One test-coverage suggestion below.

Arg::new(OPT_LOGICAL)
.short('L')
.long(OPT_LOGICAL)
.overrides_with(OPT_STRIP)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] New override precedence (-L clears -s; -P clears -s and -L) changes combined-flag behaviour, but no test pins it: crates/bashkit/src/builtins/path.rs reads only the strip flag (let strip = matches.get_flag("strip"), line 222) and documents -L/-P as equivalent (L-FS-001), with the only strip test using -s alone (test_realpath_strip_keeps_symlinks). So realpath -s -L file now fully resolves symlinks where it previously stripped only ./.., and the outcome is order-dependent (-L -s still strips, since -s declares no override). If this matches upstream uu_app() at 2a072db29 the port is correct — please confirm — and consider a regression test in path.rs pinning -s -L / -L -s / -s -P ordering so a future regen can't silently flip it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed faithful to upstream. Fetched uutils/coreutils@2a072db29 src/uu/realpath/src/realpath.rs and the two override declarations match the regenerated surface exactly:

  • OPT_LOGICAL (-L) → .overrides_with(OPT_STRIP) — the new line in this diff
  • OPT_PHYSICAL (-P) → .overrides_with_all([OPT_STRIP, OPT_LOGICAL]) — already present before this sync, unchanged

So no code fix is appropriate here: the file is generated, and the generator reproduced uu_app() correctly.

On the behaviour note, your reading of the consequence is right. path.rs reads only the strip flag and treats -L/-P as equivalent per L-FS-001, so the one user-visible change is that realpath -s -L now resolves symlinks instead of stripping, order-dependently (-L -s still strips, since -s declares no override of its own).

The regression test you asked for is worth having, and it can only pin the new behaviour once this sync is on main — a test written against the current main would encode the old -s -L result and then break on merge. So it lands as a follow-up PR immediately after this one, covering -s, -s -L, -L -s, -s -P and -P -s. I'll link it on this thread once it is open.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up with the regression test is open: #3026.

It pins all seven cases (-s, -s -L, -L -s, -s -P, -P -s, -L, -P) against GNU coreutils 9.4 on the same /l -> /a/b layout, and bashkit matches on every one — so the new precedence this sync introduced is the GNU-correct behaviour, not just a surface change. I also checked the test is a real guard: dropping .overrides_with(OPT_STRIP) from the generated file makes it fail.


Generated by Claude Code

@bashkit-pr-reviewer

Copy link
Copy Markdown

Review summary — #3025 (coreutils args/vendored sync 8b16a3dca → 2a072db29)

Verdict: Looks good to merge. The sync is exactly what it claims to be: 18 of 20 files are header-only Source: rev-bump lines with no code change, plus the UUTILS_REVISION constant bump in generated/mod.rs (the static generated_args_headers_match_pinned_uutils_revision test enforces that invariant). No action needed on those.

Findings: 1 × P2 (non-blocking) — generated/realpath_args.rs gains upstream's new precedence (-L overrides -s; -P overrides -s and -L). Since builtins/path.rs implements -s but treats -L/-P as equivalent per L-FS-001, the combination realpath -s -L now flips from lexical-only to full symlink resolution, order-dependently. Assuming the codegen is faithful to upstream uu_app() (it is generated, not hand-edited, so no code fix is appropriate), the ask is a regression test in path.rs pinning the -s/-L/-P ordering. See the inline comment.

Context read beyond the diff: generated/realpath_args.rs (full), generated/mod.rs, builtins/path.rs Realpath impl + existing -s test, knowledge/runtimes/coreutils-args-port.md, knowledge/operations/limitations.md (header), vendored.toml (no rev pin — rev is a CLI arg, nothing stale), AGENTS.md project rules.

Not reviewed: nothing — truncated: false on the diff; the +21/−20 line count is fully accounted for (18 header-only files + realpath_args.rs +2/−1 + mod.rs +1/−1). Reasoned from code only; no build or test run per sandbox limits. No security/sandbox concerns: argument-surface metadata only, no new host/env/file access (vendored format/extendedbigdecimal/num_parser bodies are byte-identical apart from headers).

@chaliy
chaliy merged commit d789dac into main Nov 30, 2026
114 checks passed
@chaliy
chaliy deleted the chore/coreutils-args-drift branch November 30, 2026 09:13
chaliy added a commit that referenced this pull request Nov 30, 2026
The coreutils args sync in #3025 gave realpath's -L an overrides_with(strip)
and left -P with overrides_with_all([strip, logical]), so a trailing -L/-P
clears -s while a trailing -s survives them. Nothing pinned that, so a
future coreutils-args-drift regen could flip it silently.

Add a table-driven test over -s, -s -L, -L -s, -s -P, -P -s, -L and -P with
expectations taken from GNU coreutils 9.4, and note the override in the
Realpath doc comment.
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