Skip to content

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

Closed
StarMrGamer wants to merge 1 commit into
boykopovar:mainfrom
StarMrGamer:fix/astrobot-asobi-root-env
Closed

StarMrGamer wants to merge 1 commit into
boykopovar:mainfrom
StarMrGamer:fix/astrobot-asobi-root-env

Conversation

@StarMrGamer

Copy link
Copy Markdown
Contributor

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

…olution

ASTRO BOT builds paths with %ASOBI_ROOT% tokens and expands them via
getenv. Without the variable the title's expansion leaves the literal
token, stat calls fail, and the sound config never loads.

Set 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.

Tested: ASTRO BOT (PPSA21564) boots without requiring a user-set
ASOBI_ROOT environment variable. The sound config loads and the title
runs stable for 60+ seconds.

Tests: asobi_root_environment verifies getenv returns app0 by default
and respects setenv overrides. All tests pass except linux_guest_stack
(host quirk) and agc_driver_pixel_interlock (unrelated).
@StarMrGamer

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant