Repository navigation
chore: sync uutils/coreutils argument surfaces and vendored modules - #3025
Conversation
… 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
Deploying with
|
| 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 |
| Arg::new(OPT_LOGICAL) | ||
| .short('L') | ||
| .long(OPT_LOGICAL) | ||
| .overrides_with(OPT_STRIP) |
There was a problem hiding this comment.
[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.
There was a problem hiding this comment.
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 diffOPT_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
There was a problem hiding this comment.
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
Review summary — #3025 (coreutils args/vendored sync
|
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.
Automated regeneration of argument surfaces and vendored modules
ported from uutils/coreutils.
Source revision:
2a072db29(was8b16a3dca)Utilities: cat ls mktemp od readlink realpath shuf stat tac tee truncate
Vendored modules: format
Trigger:
.github/workflows/coreutils-args-drift.ymlThis PR bumps
UUTILS_REVISIONincrates/bashkit/src/builtins/generated/mod.rs, the matching<util>_args.rsfiles, and any vendored module treesatomically — args codegen, module-vendor mode, and the
body-drift harness all stay aligned to the same rev.
Review the diff to confirm whether upstream:
format/)Squash-merge as a human so the merge commit is attributed
correctly per
AGENTS.md. Intermediate bot commits in this PRare discarded by squash.
Design:
knowledge/runtimes/coreutils-args-port.md.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.