fix(trace): preserve Unicode output paths on Windows #7599
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7599"
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 THEMANnt on 2026-10-18T16:33:27Z.
What
On Windows, setting
APS5_TRACE_DIRto a directory containing characters such as™or Japanese text can throwfilesystem error: Cannot convert character sequence: Illegal byte sequencewhen trace output is initialized. The narrow environment-variable value is passed through a locale-dependent filesystem conversion.Read this path with
_wgetenvon Windows and construct it from the native wide string. Put the shared directory selection inTraceFile::Directory, used by both interval summaries and captured traces. POSIX continues to usegetenv; an unset variable still selects..The Windows regression checks unset and ASCII settings, preserves a Unicode path, and writes both gzip trace and JSONL summary files there. No title-specific handling is added.
Tested
Current revision
4593f50e7, rebased onto upstream maindb73af350, Windows 11 Pro build 26200, supported MinGW-w64 GCC 15.2, Release:agc_performance_traceandagc_profile_output: both build and pass on this branch, including the Unicode directory regression. Conventions against targetupstream/mainand whitespace pass.origin/mainreports the pre-existingAPS5_CPU_FLIP_IN_ORDERenvironment-documentation error and upstream debt warnings; none of that code is changed here.Directory()call from its benchmark additions. The Unicode test body and production fix are unchanged by this follow-up.tools/pr_overlap.py --branch fix/trace-unicode-paths, using authenticated API transport and that exhaustive candidate set, reportsNo overlap with open pull requests.88f818410218ca4aa117d850354a50f0a1fe4b62. A separate local integration build succeeds;agc_profile_outputandparam_json_parserpass. Its expandedagc_performance_tracetest fails withSt13__ios_failure ... has no unwind data. A control containing main + #7080 without this PR reproduces the same failure. The combined suite is therefore not claimed green; that exception-handling failure is separate from this branch's resolved merge overlap.Earlier validation at
d7738226dremains applicable to the unchanged Unicode fix: the narrow-conversion negative control fails; the wide-path test passed five repeated runs; the runtimelibstarget and four focused trace/registration tests built and passed. An independent Windows/Linux validation is recorded in wachi35676's comment. Full runtime libraries, registration GPU tests and Linux/macOS were not rerun for this test-layout-only follow-up. No performance claim.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 wachi35676 on 2026-10-19T00:13:03Z.
Checked at
d7738226dwith the variable inherited from the parent process rather than set in-process (PowerShell, ACP 1252, the same libstdc++). Comparinggetenv→pathwith this PR's_wgetenv→path:café,tm™(in cp1252): the narrow form throwsCannot convert character sequence: Illegal byte sequence.日本語,жу,emoji😀(not in cp1252; the last is a surrogate pair):getenvreturns?, and the narrow form fails withcannot create directories: Invalid argument [...\???]._wgetenvcreates the right directory and writes the file in all six cases.Tests:
agc_performance_trace,agc_profile_outputand bothagc_driver_registration_tracetests pass on Windows (GCC 15.2).getenvput back intoTraceFile::Directory,agc_performance_tracefails with the conversion error.agc_performance_traceandagc_profile_outputpass.The same narrow
getenv→pathpattern exists forAPS5_DUMP_SUBMITSinSubmissionCapture.cpp:104, if a follow-up is wanted.AI-assisted: yes (Claude Code); results above were run on this machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T23:38:29Z.
Review: APPROVED
The Windows path is read as wide text and kept in
std::filesystem::pathwithout a locale-dependent narrow conversion; the POSIX path remains unchanged. The new test covers unset, ASCII and Unicode values and verifies both summary and gzip output. The reported Windows negative control and independent cross-platform test results support the fix; the current conventions, eligibility and report checks pass. I also rerantools/pr_overlap.pyagainst the current open PR queue (1,105 PRs), and it reports no overlap. I did not run the product tests locally. No blocking issue found; approved.