Skip to content

chore(builtins): sync uutils/coreutils argument surfaces and vendored modules - #2746

Merged
chaliy merged 1 commit into
mainfrom
eve/clever-mccarthy-ywe00s
Oct 17, 2026
Merged

chaliy merged 1 commit into
mainfrom
eve/clever-mccarthy-ywe00s

Conversation

@chaliy

@chaliy chaliy commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Regenerated the ported coreutils argument surfaces and the vendored uucore::format
module against uutils/coreutils@8613dffab (was 6579cc2), bumping
UUTILS_REVISION and the 20 generated files together.

Utilities: cat ls mktemp od readlink realpath shuf stat tac tee truncate.
Vendored module: format.

format module — inert in bashkit

  • EscapeSet (new) — parse_escape_code/parse_escape_only now take an escape-set
    argument selecting whether \", \u and \U are escapes. Both vendored call sites
    (parse_spec_and_escape for format strings, %b in spec.rs) pass
    WithUnicodeAndQuote, which is exactly what the code did unconditionally before. The
    WithoutUnicodeAndQuote arm is upstream's echo-style path and is unreachable from bashkit.
  • %q — moves from locale_aware_escape_name(.., SHELL_ESCAPE) to upstream's new
    locale_aware_shell_escape shorthand. The shim routes both to the same shell_quote.
  • QuotingStyle::C_NO_QUOTES → QuotingStyle::Escape — the rename the shim
    pre-absorbed in fix(builtins): track uucore quoting-style rename in printf shim #2738; both map to the same no-op escaping, and
    DIAGNOSTIC_QUOTING_STYLE already named the new spelling, so printf's
    diagnostic prefix-matching stays in step.
  • set_exit_code — calls move into the per-error match arms. It is a no-op in
    bashkit, which reports status through ExecResult.
  • Float formatting — format_float_decimal/format_float_scientific gain upstream's
    bounded zero-padding: fractional digits capped at u16::MAX, and integer
    zero-extension refused past the existing MAX_FORMAT_WIDTH (1M) instead of formatting
    at an unbounded precision. This tightens a resource bound rather than loosening one.

Argument surfaces — two small accepted-input changes

ls and od build their clap commands from the generated definitions, so these are
user-visible at the parsing layer:

  • od gains -B as a short alias for --skip-bytes, and its help text changes
    Skip bytes input bytes → Skip BYTES input bytes. -B is newly accepted.
  • ls drops the mutual overrides_with between --dired and --hyperlink, and
    --hyperlink=c-maybe becomes its own possible value rather than an alias of c.
    bashkit's ls implementation reads neither flag (both parse and are ignored), so the
    observable result is unchanged; only which combinations clap accepts shifts.

Everything else in the *_args.rs files is the revision header.

Why

This is the drift the weekly coreutils-args-drift run had been detecting but never
surfacing. The run was failing outright since the uucore quoting-style rename (fixed in
#2738), and its PR path edited a closed PR instead of opening one (fixed in #2745). With
both repaired, this is the backlog that had accumulated — regenerated by the workflow
itself (run 39019907688),
not by hand.

Before / After

Because %b/%q/float formatting were the paths most exposed, the same 20 printf cases
were run against real bash (5.2.21) with the generated tree before and after this
change, built from the same tree otherwise:

pass fail
Pre-drift (main) 17 3
Post-drift (this PR) 17 3

The three divergences are byte-identical before and after, so none is introduced here:

printf '%b\n' 'q\"q'            bash: q\"q                   bashkit: q"q
printf '%b\n' 'x\U0001F600y'    bash: x\U0001F600y           bashkit: x😀y
printf '%q\n' 'com espaço'      bash: $'com espa\303\247o'   bashkit: com\ espaço

These are pre-existing, intentional bashkit-vs-bash differences (bashkit's printf follows
coreutils semantics for \u/\U and %q), unrelated to this sync.

Other validation on the regenerated tree:

  • cargo build -p bashkit clean; cargo fmt --check clean.
  • cargo test -p bashkit --lib → 3061 passed.
  • cargo test -p bashkit --test integration -- spec_tests → 4 passed (bash/awk/grep/sed spec suites).
  • cargo test -p bashkit --test integration -- printf → 18 passed.
  • knowledge/status/builtins.json needs no regeneration: it records {feature, name} per
    builtin (230 entries) and carries no flag-level detail, so the ls/od arg changes
    cannot drift it.
  • The drift run itself built the uutils multicall from the same tree and ran the
    BASHKIT_RUN_COREUTILS_DIFF=1 differential harness and cat/tac spec tests.

The strict host-bash/grep/sed comparison gates are #[ignore]d locally and run in CI
(ci.yml), so they are covered by this PR's own CI rather than reproduced here.

Risk

  • Low. Generated-only diff, confined to crates/bashkit/src/builtins/generated/. No
    hand-written code, no public API, no feature flags touched.
  • The float-formatting change narrows an allocation bound; the escape-set change is a
    no-op at both call sites, as the differential above shows.
  • The od -B alias widens accepted input by one flag, matching upstream.

Checklist

  • Tests added or updated — existing printf/format/spec/ls/od suites cover these paths;
    the change is a regeneration with no new code paths reachable from bashkit
  • Backward compatibility considered

… modules

Regenerated by `bashkit-coreutils-port` against uutils/coreutils@8613dffab
(was 6579cc2). Utilities: cat ls mktemp od readlink realpath shuf stat tac
tee truncate. Vendored module: format.

Behaviour is unchanged in bashkit:

- `parse_escape_only`/`parse_escape_code` take upstream's new `EscapeSet`.
  Both vendored call sites pass `WithUnicodeAndQuote`, which is what the
  code did unconditionally before, so `%b` and format-string escapes keep
  treating `\"`, `\u` and `\U` as escapes.
- `%q` moves from `locale_aware_escape_name(.., SHELL_ESCAPE)` to upstream's
  `locale_aware_shell_escape` shorthand; the shim routes both to the same
  `shell_quote`.
- `QuotingStyle::C_NO_QUOTES` becomes `QuotingStyle::Escape` (the rename the
  shim pre-absorbed in #2738); both map to the same no-op escaping, and
  `DIAGNOSTIC_QUOTING_STYLE` already named the new spelling.
- `set_exit_code` calls move into the per-error match arms. It is a no-op in
  bashkit, which reports status through `ExecResult`.

`format_float_decimal`/`format_float_scientific` gain upstream's bounded
zero-padding: fractional digits are capped at `u16::MAX` and integer
zero-extension is refused past the existing `MAX_FORMAT_WIDTH` (1M) instead
of formatting at an unbounded precision.
@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 7bcdd93 Commit Preview URL

Branch Preview URL
Oct 17 2026, 10:11 AM

@chaliy
chaliy merged commit a6f37d4 into main Oct 17, 2026
50 checks passed
@chaliy
chaliy deleted the eve/clever-mccarthy-ywe00s branch October 17, 2026 11:16
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