feat(libSceSystemService): take the console date and time format from ANYPS5_DATE_FORMAT and ANYPS5_TIME_FORMAT, with auto from the host #12848
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12848"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T12:33:25Z.
What
sceSystemServiceParamGetIntanswered a fixed 1 for the date format (parameter 2, day-month-year) and a fixed 1 for the time format (parameter 3, 24-hour). Two new variables, siblings ofANYPS5_LANGUAGE:ANYPS5_DATE_FORMAT: 0 year-month-day, 1 day-month-year, 2 month-day-year, orauto.ANYPS5_TIME_FORMAT: 0 12-hour, 1 24-hour, orauto.Unset and empty answer 1 and 1 exactly as before (read at each query).
auto(any letter case) maps the host's short date and time patterns once per process; if the host has no preference or the pattern has no console format the answer stays 1 and one stderr line names the variable. Any other text stops the game at the first query of that parameter with an error naming the variable.Numbers: 0/1/2 and 0/1 follow OpenOrbis-PS4-Toolchain 06fcf7fd108fa080035cdd3259ed22eb07e0508c (
sys_service.hL17-L28) and shadPS4 0614ce324be092791b758d79f93d9f1ca5b10a81 (systemservice.hL29-L38). Neither is a console measurement; recorded in the debt doc. Time zone and summer time (parameters 4 and 5) already follow the host and are untouched. Week start is not implemented: no parameter id for it is sourced (debt entry). libSceRtc does not read these parameters.Design (all in the new header
core/libs/prx/libSceSystemService/DateTimeLocale.hpp, header only):%x/%c/%Xgives no answer.HostPatterns: POSIX (LC_ALL,LC_TIME,LANG;D_FMTandT_FMTthroughnewlocale/nl_langinfo_l, the process locale is untouched; C/POSIX count as no preference;T_FMT_AMPMis deliberately unused, glibc fills it for 24-hour locales), Windows (GetLocaleInfoExLOCALE_SSHORTDATE/LOCALE_STIMEFORMAT), macOS (CFDateFormattertemplatesyMd/jms). Reader and environment are injected so the tests need no locale.Commits (29): classifiers, each followed by its test; resolver; POSIX/Windows/macOS sources; parsing; Export.cpp wiring (2 lines + include); guest test; env reference; one commit per debt statement; usage.
Overlap with open PRs (branched from upstream/main, not stacked): #12752 (
ANYPS5_LANGUAGE=auto) shares no source file (it edits LanguageLocale.hpp and SystemService.hpp, which this PR does not touch) but both edit libSceSystemService/CMakeLists.txt (different blocks, mine next toguest_system_service_usb_storage), docs/dev/ENVIRONMENT.md (rows next toANYPS5_LANGUAGE), docs/user/USAGE.md (new section after "Console language", which #12752 rewrites) and docs/dev/debt/libSceSystemService.md (it adds entries after the language entry; this PR appends a clause to the end of that language entry and adds entries after the time zone one). Expect trivial textual conflicts there. #9586 edits Export.cpp, CMakeLists.txt, SystemService.hpp and the debt doc; here Export.cpp changes only the twocaselines of parameters 2 and 3 and one include. No open PR implements date or time format settings.Tested
Linux x86_64 (Debian 12, kernel 6.1), GCC 12, throwaway archive build rebased on upstream/main
aaccd0ba39plus 240 commits (HEAD d9c2d08964),BUILD-EXIT 0.system_service_date_time_locale(host-only: classifiers, resolver and notice text, POSIX source with injected environments and nine glibc locales, realReadLangInfoon C and an unknown name, setting parser),guest_system_service_date_time_format(unset/empty, 0..2 and 0..1, near misses refused per variable, neighbouring parameters, null pointers) andguest_system_service_date_time_format_host_0..11(auto with nothing set, C, POSIX, an uninstalled locale, mixed with explicit and invalid values; exact stderr notice counts; a later host change does not change the answer).guest_system_service,guest_system_service_language,guest_system_service_time_zonepass on the branch and with Export.cpp restored to upstream/main in the same tree (baseline); the new default cases (host_7andhost_9: explicit 1/1 and unset) also pass on the baseline, the other eleven guest tests fail there as expected.%x,t,a,K). Not controllable: thetext.size()guard in theautocomparison (guards an out-of-bounds read; the mutation is equivalent in practice), and the doubled-quote branch, which was equivalent and is removed in its own commit.check_conventions.py --base upstream/main(one warning: the existing language entry in the debt doc was already over 1000 characters and the one-clause edit makes the checker report it; no errors),git diff --check,test_public_headers.py --audit-only,env_reference.py --checkclean.NOT RUN: Windows (
GetLocaleInfoExbranch only syntax-checked with MinGW), macOS (CoreFoundation branch only syntax-checked against a stub; theyMd/jmsoutputs and the 24-hour override are unverified), musl and BSD libc, a non-English real host through the whole stack, a console, any title.guest_user_serviceandguest_convert_keycodewere not built (they do not touch these parameters).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T20:02:42Z.
Review: COMMENTED
Correction (2026-11-01): this review demanded a title for a PR where no title can supply one. CONTRIBUTING allows
Unblocks: none. The technical points below are unaffected.No title ID and no log line: the description names none, and
libSceRtc does not read these parameters. Unset keeps today's answer, so nothing onmainchanges until a user opts in; this is a convenience feature, not a fix for a title.auto, "if the host has no preference or the pattern has no console format the answer stays 1 and one stderr line names the variable". That returns a made-up answer (day-month-year, 24-hour) for a host the code could not classify. Upstream has been rejecting logged fallbacks of that kind; the exact-or-throw behaviour is to throw namingANYPS5_DATE_FORMAT/ANYPS5_TIME_FORMAT, as the explicit-text path already does.GetLocaleInfoExbranch is only syntax-checked with MinGW and the macOS CoreFoundation branch only against a stub, with theyMd/jmsoutputs and the 24-hour override unverified. I would not take those two branches in without a build on those hosts.docs/dev/ENVIRONMENT.mdanddocs/user/USAGE.mdand touchlibSceSystemService. Worth agreeing the landing order with the other two authors.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:58:10Z.
Review: COMMENTED
Reviewed — four review points need an answer; the fallbacks are confirmed
CnRJay asks for exact-or-throw on
autowhen the host has no usable pattern, and for the sources of the numbers. The head returns day-month-year and 24-hour with a logged notice, and the debt entry does not say which source the default 1 comes from.What I ran
Live head: 62e5106cbbba31500ffa5e798611b8ff8b404d9a (OPEN, same as the batch file). Read the comments and reviews with
gh api(repos/boykopovar/AnyPS5/issues|pulls/12848/...). Read files withgit -C /marc/AnyPS5 show 62e5106c…:<path>: DateTimeLocale.hpp, CMakeLists.txt, docs/dev/debt/libSceSystemService.md, CONTRIBUTING.md. Read the hosted check rollup withgh pr view. Nothing was built or run.Results
Findings
ResolveHostDateFormatnotes and returns 1 (DateTimeLocale.hpp L151-L160).ResolveHostTimeFormatnotes and returns 24-hour (L163-L172).DATE_FORMAT_DDMMYYYY = 1(L27) andTIME_FORMAT_24HOUR = 1(L30). The debt entry (docs/dev/debt/libSceSystemService.md L27) cites OpenOrbis and shadPS4 and does not say which one the default 1 came from.GetLocaleInfoExis at L236-L255, macOS CoreFoundation at L256-L280. The_host_*date tests are registered only under Linux (CMakeLists.txt L119-L135), so no registered test reaches the macOS host patterns. tkcm01's macOS run (2026-10-29) was on an earlier head, d9c2d08, and I did not re-run it.none.Sources
github.com/boykopovar/AnyPS5@62e5106cbb/core/libs/prx/libSceSystemService/DateTimeLocale.hpp (L151-L172)github.com/boykopovar/AnyPS5@62e5106cbb/core/libs/prx/libSceSystemService/DateTimeLocale.hpp (L27-L30)github.com/boykopovar/AnyPS5@62e5106cbb/docs/dev/debt/libSceSystemService.md (L27-L27)github.com/boykopovar/AnyPS5@62e5106cbb/core/libs/prx/libSceSystemService/CMakeLists.txt (L119-L135)Not verified