Skip to content

fix(find): %Tq/%TN follow glibc strftime — unbreak engines-find gate shard on main (#1488) - #1858

Merged
caomengxuan666 merged 1 commit into
mainfrom
devin/2026112221-find-printf-glibc-strftime
Nov 22, 2026
Merged

caomengxuan666 merged 1 commit into
mainfrom
devin/2026112221-find-printf-glibc-strftime

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes the red rust2-gate-shards (engines-find) job. It fails on the latest main run of CMake Windows Multi-Arch CI (45014878211). That run's GNU-differential build failure is handled separately by #1857. It is work-queue item 0, broken main, for #1488.

Root cause: find -printf renders %Ak/%Bk/%Ck/%Tk through the shared date::strftime. The date parity work taught that function the gnulib nstrftime extension %q (quarter). GNU find calls the C library strftime instead, and glibc 2.39 has no %q or %N, so it echoes the directive as-is. As a result, gate row fd262-printf-time-T-names printed 1 where the GNU oracle prints %q.

Fix: a new strftime_letter helper in find/printf.rs returns %q / %N verbatim and forwards every other letter to date::strftime. date(1) keeps its gnulib behaviour.

Probe against the WSL oracle (findutils 4.9.0, glibc 2.39), comparing every %T<letter> from a to z and A to Z: only q and N differed between rust2 and GNU.

Tests

  • New unit test find::printf::tests::time_letters_follow_glibc_strftime.
  • New gate row fd271-printf-time-glibc-unknown (%Tq|%TN|%AN|%Cq), added to gen-cases.py; find.tsv was regenerated, but only the find rows were kept.
  • bash rust2/gate/run-gate.sh find locally:
    • GNU-gated rows: 308 PASS / 0 FAIL (before the fix: 306 / 1, fd262).
    • win-only rows: the 10 rows fd280–fd289 fail locally only, because this box has no C++ build (c_rc=127). CI provides the C++ side.
  • cargo test -p winux-cmds --lib find:: passes, 26 tests.

Note: this VM has no MSVC toolchain, so the local driver was built with the x86_64-pc-windows-gnu toolchain. CI builds the MSVC driver.

i18n

No user-visible strings changed, so unixwin/winuxcmd-i18n needs no catalog sync.

Refs #1488

Written by Devin

… engines-find gate shard)

find -printf time directives call the C library strftime, not gnulib's
nstrftime that date(1) uses. Since the date parity work taught the
shared date::strftime the gnulib %q extension, find's %Tq printed the
quarter (1) where GNU findutils 4.9.0 / glibc 2.39 echoes %q, failing
gate row fd262 and turning the engines-find shard (and main CI) red.
%N had the same latent drift.

Add gate row fd271 pinning %Tq|%TN|%AN|%Cq against the oracle.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@caomengxuan666
caomengxuan666 marked this pull request as draft November 22, 2026 13:46
@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 22, 2026 16:50
@caomengxuan666
caomengxuan666 merged commit 7c225a9 into main Nov 22, 2026
30 of 32 checks passed
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