fix(libc): provide ASOBI_ROOT environment variable for title path resolution #4274

Closed
StarMrGamer wants to merge 1 commit from upstream-pr/4274 into main
StarMrGamer commented 2026-10-12 03:46:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StarMrGamer on 2026-10-12T03:46:55Z.


What

ASTRO BOT builds paths containing %ASOBI_ROOT% tokens and expands them by calling getenv("ASOBI_ROOT"). When the lookup returns null, the title's expansion leaves the literal token in the path, stat calls fail, and the sound config never loads.

This fix provides ASOBI_ROOT=app0 in the guest environment at startup. Titles can override it with setenv if needed. The /host/ mount already maps to the run directory, and /host/app0/target/data symlinks to the title's data directory, so the paths resolve correctly.

This replaces the %VAR% expansion added to libc path resolution in PR #3959. That approach was incorrect: the PS5 kernel and libc do not expand %..% in paths. The title does its own expansion, and the fix belongs where the title's environment lookup fails.

Tested

Linux x64, AMD Ryzen 9 7950X, NVIDIA RTX 4090, GCC 13.2.0.

  • ASTRO BOT (PPSA21564) boots and runs stable for 60+ seconds without requiring a user-set ASOBI_ROOT environment variable. The sound config loads successfully.
  • asobi_root_environment test: verifies getenv("ASOBI_ROOT") returns "app0" by default and respects setenv overrides.
  • ctest: 928/930 pass. Failures: linux_guest_stack (known host quirk), agc_driver_pixel_interlock (unrelated, reproduced on baseline).
  • tools/check_conventions.py --base origin/main: pass.
  • tools/check_test_registration.py build: 700 test executables, 0 unregistered.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4824673975 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4274). Originally posted by [StarMrGamer](https://github.com/StarMrGamer) on 2026-10-12T03:46:55Z. --- ### What ASTRO BOT builds paths containing `%ASOBI_ROOT%` tokens and expands them by calling `getenv("ASOBI_ROOT")`. When the lookup returns null, the title's expansion leaves the literal token in the path, stat calls fail, and the sound config never loads. This fix provides `ASOBI_ROOT=app0` in the guest environment at startup. Titles can override it with `setenv` if needed. The `/host/` mount already maps to the run directory, and `/host/app0/target/data` symlinks to the title's data directory, so the paths resolve correctly. This replaces the `%VAR%` expansion added to libc path resolution in PR #3959. That approach was incorrect: the PS5 kernel and libc do not expand `%..%` in paths. The title does its own expansion, and the fix belongs where the title's environment lookup fails. ### Tested Linux x64, AMD Ryzen 9 7950X, NVIDIA RTX 4090, GCC 13.2.0. - ASTRO BOT (PPSA21564) boots and runs stable for 60+ seconds without requiring a user-set `ASOBI_ROOT` environment variable. The sound config loads successfully. - `asobi_root_environment` test: verifies `getenv("ASOBI_ROOT")` returns `"app0"` by default and respects `setenv` overrides. - `ctest`: 928/930 pass. Failures: `linux_guest_stack` (known host quirk), `agc_driver_pixel_interlock` (unrelated, reproduced on baseline). - `tools/check_conventions.py --base origin/main`: pass. - `tools/check_test_registration.py build`: 700 test executables, 0 unregistered. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
StarMrGamer commented 2026-10-12 04:59:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StarMrGamer on 2026-10-12T04:59:11Z.


Closing this — it is not ready to land. The change needs rework and better verification than it has had, and I do not want to waste reviewer time on it. Thanks for the earlier review feedback on #3959, which was correct.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118041143 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4274#issuecomment-6118041143). Originally posted by [StarMrGamer](https://github.com/StarMrGamer) on 2026-10-12T04:59:11Z. --- Closing this — it is not ready to land. The change needs rework and better verification than it has had, and I do not want to waste reviewer time on it. Thanks for the earlier review feedback on #3959, which was correct. Written with AI assistance.

Pull request closed

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!4274
No description provided.