Repository navigation
fix(builtins): track uucore quoting-style rename in printf shim - #2738
Merged
Merged
Conversation
The weekly Coreutils Args Drift run has failed since 2026-10-05. It re-ports vendored uucore modules against upstream HEAD, and the regenerated `format/` no longer compiles against our handwritten shim: upstream renamed `QuotingStyle::C_NO_QUOTES` to an `Escape` variant and extracted `locale_aware_shell_escape` as a shorthand for `%q`. Both are pure renames. `Escape` and the old `C_NO_QUOTES` both select uucore's `CQuoter` with `CQuotesEnforce::None` and both are what `--quoting-style=escape` resolves to; `locale_aware_shell_escape(x)` is `locale_aware_escape_name(x, SHELL_ESCAPE)` returning `String`. The shim carries both spellings so it builds against the current pin and against upstream HEAD, which is what unblocks the drift run. `printf` reverse-matches the vendored module's numeric diagnostics by re-quoting candidate arguments with the same style, and a drift PR may only touch generated files, so it cannot keep `printf.rs` in step. The style is now named once as `DIAGNOSTIC_QUOTING_STYLE`, and a test scans the generated module for the style it actually uses and fails if that style escapes differently. Claude-Session: https://claude.ai/code/session_0112F7oWpuuyUKiXHbhqRGc1
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 7eeb5e4 | Commit Preview URL Branch Preview URL |
Oct 16 2026, 09:31 AM |
This was referenced Oct 17, 2026
chaliy
added a commit
that referenced
this pull request
Oct 17, 2026
… modules (#2746) 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. The vendored `format` module is inert 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 to upstream's `locale_aware_shell_escape` shorthand; the shim routes it and the old spelling 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. - `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 bounded zero-padding: fractional digits capped at `u16::MAX`, integer zero-extension refused past the existing `MAX_FORMAT_WIDTH` (1M). Two argument surfaces widen slightly, matching upstream: `od` gains `-B` as a short alias for `--skip-bytes`, and `ls` drops the mutual `overrides_with` between `--dired` and `--hyperlink` while `--hyperlink=c-maybe` becomes its own possible value. bashkit's `ls` reads neither flag. Verified by running 20 printf cases against real bash 5.2.21 with the tree before and after: identical results both ways (17 match, 3 pre-existing coreutils-vs-bash divergences in `%b \u`/`\U` and `%q`).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The weekly Coreutils Args Drift workflow runs again. It has failed every
scheduled run since 2026-10-05, so bashkit has silently stopped tracking
upstream uutils for two cycles.
The handwritten
format_supportshim now provides both spellings of twouucore symbols that upstream renamed, so the vendored
formatmodulecompiles whether it is regenerated against the current pin or against
upstream HEAD. No runtime behavior changes.
Separately, the style
printfuses to recover a rejected numeric argumentis now named once and enforced by a test, closing a silent-failure path the
drift PR could not have fixed itself.
Why
The drift job re-ports vendored uucore modules against upstream HEAD, then
builds. Upstream renamed
QuotingStyle::C_NO_QUOTESto anEscapevariantand extracted
locale_aware_shell_escapeas a%qshorthand, so theregenerated code referenced symbols the shim did not have:
Both are pure renames.
EscapeandC_NO_QUOTESboth select uucore'sCQuoterwithCQuotesEnforce::None, and both are what--quoting-style=escaperesolves to;locale_aware_shell_escape(x)islocale_aware_escape_name(x, SHELL_ESCAPE)returningString.The failure is invisible by construction: the job only runs Mondays, and it
dies at Verify build still passes — after regeneration, before the patch
upload — so no PR ever opens and nothing reports the breakage.
Carrying both spellings is deliberate. The pinned
generated/format/stillsays
C_NO_QUOTESwhile the regeneration saysEscape, and the shim has tosatisfy both at once or the drift run cannot reach its own build step. The
old spelling is dropped once the pin moves past the rename; the condition is
written down in the knowledge entry.
The coupling the drift PR could not repair
printf'snumeric_argument_diagnosticsrecovers a rejected argument byre-quoting each candidate with the same
QuotingStylethe vendored moduleused, then prefix-matching the diagnostic. The
open-prjob enforces agenerated-only diff, so it can never update
printf.rs— a style mismatchwould have dropped
printf: <arg>: invalid numbersilently, and only forarguments the two styles escape differently. Plain
abcescapes to itselfunder every style, so
printf_invalid_number_stderrcould not catch it.The style is now
format_support::DIAGNOSTIC_QUOTING_STYLE, and a testscans
generated/format/argument.rsfor the styles it actually names,failing if any escapes differently.
Before / After
Re-running the workflow's own steps locally against upstream HEAD
781b4991d(pin is6579cc2), on this branch vs. its parent:port-module format+ 11 arg surfacescargo build -p bashkitcargo test --test integration -- spec_tests::bash_spec_tests1 passedcargo test --test integration -- coreutils_differential_tests::22 passedThe differential run used a
coreutilsmulticall built from that sameupstream tree, matching how the workflow builds it. That is the last step of
the
regeneratejob, so the whole job now passes end to end.Regenerated code confirmed to use the new names:
The coupling guard passes in both states — against the pinned tree
(
C_NO_QUOTES) and against the regenerated tree (Escape) — which is theproperty that makes the upcoming drift PR safe to merge.
No user-visible behavior change:
printfreports the raw argument, as bashdoes, and the escaped form is only ever a matching key. The new printf test
pins the control-character case against bash 5.2.21:
Risk
resource limits touched. The two upstream changes are renames verified
against uutils source at both revisions, not semantic changes.
early the drift run breaks again — which is why the removal condition is
recorded in
knowledge/runtimes/coreutils-args-port.mdrather than left tomemory.
next run opens the regeneration PR for review, as designed.
Checklist
https://claude.ai/code/session_0112F7oWpuuyUKiXHbhqRGc1
Generated by Claude Code