fix(apple): pin C locale for perf ps reads on macOS
Summary
perf on macOS reads CPU and memory from ps -axo pid=,%cpu=,rss=,command=. BSD ps formats %cpu with the host LC_NUMERIC, so under de_DE, fr_FR or es_ES it prints 12,5. parseApplePsOutput only accepts a . decimal, so every row is dropped and the app process is never found.
The host ps reads in perf-target.ts now pass envOverrides: { LC_ALL: 'C.UTF-8' }, the same pin host-process.ts already uses for its ps reads (and the same fix #4682 applied to lstart). The parser also accepts a comma decimal, for reads that cannot be pinned, such as simctl spawn ps.
Before / after
ps row under LANG=de_DE.UTF-8: 123 12,5 45678 /Applications/Test.app/Contents/MacOS/Test
before: parseApplePsOutput -> [] (perf finds no process)
after: parseApplePsOutput -> [{ pid: 123, cpuPercent: 12.5, rssKb: 45678, ... }]
Validation
- Tested at
41ac39e. Two new tests inperf-target.test.ts: comma-decimal parsing, and the locale pin on the macOSpscall. Both fail onmainand pass with the fix. vitest runonperf-target.test.tsandperf.test.tspasses (27 tests).oxfmt --checkandtsc --noEmitare clean.- No macOS device run; the change only affects the
psenvironment and parsing.
This change was prepared with AI assistance.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.