feat(libc): implement wcsftime #4226

Merged
MarcZX10 merged 1 commit from upstream-pr/4226 into main 2026-10-13 09:01:11 +00:00
MarcZX10 commented 2026-10-12 01:46:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T01:46:39Z.


What

Adds the missing wcsftime export for PS5MC (NID XbVXpf5WF28) using the guest's 16-bit wide strings and the existing C-locale conversion routines. The implementation follows FreeBSD 11.4 behavior for conversion errors, empty/truncated output, overflow, and null arguments, including restoring errno around Windows CRT strftime behavior. Adds regression coverage to guest_wide_formatting and records the source behavior in docs/dev/debt/libc.md. The original implementation commit author is preserved.

Tested

  • A prior Linux rebase handoff reported a full suite pass; that result was not run on this current-main head.
  • The current-main rebase has not been built or tested locally. CI should rerun against this head.

Checklist

  • Rebased onto current main; no matching open PR
  • One topic: the wcsftime export and its tests/documentation
  • Kept the existing strftime technical-debt entry
  • Removed the duplicate kern.arandom line while preserving the existing entry
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4823969908 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4226). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T01:46:39Z. --- ### What Adds the missing `wcsftime` export for PS5MC (NID `XbVXpf5WF28`) using the guest's 16-bit wide strings and the existing C-locale conversion routines. The implementation follows FreeBSD 11.4 behavior for conversion errors, empty/truncated output, overflow, and null arguments, including restoring errno around Windows CRT `strftime` behavior. Adds regression coverage to `guest_wide_formatting` and records the source behavior in `docs/dev/debt/libc.md`. The original implementation commit author is preserved. ### Tested - A prior Linux rebase handoff reported a full suite pass; that result was not run on this current-main head. - The current-main rebase has not been built or tested locally. CI should rerun against this head. ### Checklist - [x] Rebased onto current `main`; no matching open PR - [x] One topic: the `wcsftime` export and its tests/documentation - [x] Kept the existing `strftime` technical-debt entry - [x] Removed the duplicate `kern.arandom` line while preserving the existing entry - [x] Depends on: none - [x] AI-assisted: yes
MarcZX10 commented 2026-10-12 01:46:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T01:46:45Z.


Carried #3625’s ready commit onto current main; the author is preserved. Local conventions and diff checks pass, but Linux CMake configure is blocked here by the missing SDL2 submodule contents and audio development headers, so the PR body records the original Windows test results and local limitation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116294545 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4226#issuecomment-6116294545). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T01:46:45Z. --- Carried #3625’s ready commit onto current main; the author is preserved. Local conventions and diff checks pass, but Linux CMake configure is blocked here by the missing SDL2 submodule contents and audio development headers, so the PR body records the original Windows test results and local limitation.
github-actions[bot] commented 2026-10-12 01:47:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T01:47:43Z.


Progress report (9ba9ac1 → 78ffdf0)

➖ System libraries: 87.85% (+0.0%, +1 implemented functions)

✅ 1 implemented
Library Name
libc wcsftime_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116302827 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4226#issuecomment-6116302827). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T01:47:43Z. --- <!-- progress-report --> ### Progress report (9ba9ac1 → 78ffdf0) ➖ **System libraries**: 87.85% (+0.0%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libc | `wcsftime_nid_postfix` | </details>
blawesom commented 2026-10-12 15:38:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-12T15:38:42Z.


Rebase handoff — rebased onto current main, authorship unchanged (only a TechnicalDebt.md union conflict; both entries kept).

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV):

  • builds; tools/check_conventions.py --base origin/main passes
  • full suite: 100% passed

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/4226
git checkout <your branch>
git merge --ff-only FETCH_HEAD
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6127524255 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4226#issuecomment-6127524255). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-12T15:38:42Z. --- **Rebase handoff** — rebased onto current `main`, authorship unchanged (only a `TechnicalDebt.md` union conflict; both entries kept). Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): - builds; `tools/check_conventions.py --base origin/main` passes - **full suite: 100% passed** **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/4226 git checkout <your branch> git merge --ff-only FETCH_HEAD ```
oneandonlydean commented 2026-10-13 00:58:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:58:11Z.


Needs a rebase (docs/dev/debt/libc.md, docs/dev/debt/libkernel.md). While there: keep the strftime entry in docs/dev/debt/libc.md, and drop the second kern.arandom line the branch adds to docs/dev/debt/libkernel.md.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135725718 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4226#issuecomment-6135725718). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T00:58:11Z. --- Needs a rebase (`docs/dev/debt/libc.md`, `docs/dev/debt/libkernel.md`). While there: keep the `strftime` entry in `docs/dev/debt/libc.md`, and drop the second `kern.arandom` line the branch adds to `docs/dev/debt/libkernel.md`.
MarcZX10 commented 2026-10-13 07:17:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:17:54Z.


Thanks. The current PR head still conflicts with main. I will rebase it, keep the existing strftime debt entry, and remove the duplicate kern.arandom line before asking for review again.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140404364 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4226#issuecomment-6140404364). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T07:17:54Z. --- Thanks. The current PR head still conflicts with main. I will rebase it, keep the existing strftime debt entry, and remove the duplicate kern.arandom line before asking for review again.
MarcZX10 commented 2026-10-13 07:34:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T07:34:26Z.


Rebased the PR onto current main. I kept the existing strftime debt entry, added the wcsftime entry beside it, and removed the duplicate kern.arandom line by preserving the current-main entry. I updated the description so the earlier full-suite report is not presented as a test of this rebased head; CI should rerun.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140655798 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4226#issuecomment-6140655798). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T07:34:26Z. --- Rebased the PR onto current `main`. I kept the existing `strftime` debt entry, added the `wcsftime` entry beside it, and removed the duplicate `kern.arandom` line by preserving the current-main entry. I updated the description so the earlier full-suite report is not presented as a test of this rebased head; CI should rerun.
github-actions[bot] commented 2026-10-13 07:40:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T07:40:05Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#4543 docs/dev/debt/libc.md L57
#4833 core/libs/tests/GuestWideFormatting.cpp L2
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6140741306 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4226#issuecomment-6140741306). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T07:40:05Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #4543 | `docs/dev/debt/libc.md` [L57](https://github.com/boykopovar/AnyPS5/blob/02d4839b604d068341b5514995a5af16f1befe0d/docs/dev/debt/libc.md#L57) | | | | #4833 | `core/libs/tests/GuestWideFormatting.cpp` [L2](https://github.com/boykopovar/AnyPS5/blob/02d4839b604d068341b5514995a5af16f1befe0d/core/libs/tests/GuestWideFormatting.cpp#L2) | | |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4226
No description provided.