Skip to content

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

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

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

Conversation

@renzipego-cpu

Copy link
Copy Markdown

Carries the rework of #4274 (StarMrGamer:fix/astrobot-asobi-root-env@0528bae8), pushed by its author after the verification request in #3480, rebased onto current main.

What

ASTRO BOT (PPSA21564) reads ASOBI_ROOT through getenv to build its asset paths; without it the sound configuration never loads and start-up stops at the title's own assertion:

ASSERT: D:\asobi\6.0\source\engine\app\Game\Sound\SoundManager.cpp:306
Assertion failed: defaultBusses.size() == 1

(reproduced on Windows in #3480; the issue was closed with the author's private stack, none of which is on main). The guest environment starts empty by design (70ef371, docs/dev/debt/libc.md: never reads the host's), so the title has no way to see the variable. This seeds one console-provided default, ASOBI_ROOT=app0, into the guest environment - the value follows the homebrew payload convention. The host-seeding half of the carried branch was dropped in the rebase: main's empty-environment decision postdates the branch base and takes precedence. The debt entry is updated accordingly.

Tested

Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), Ninja, Release, BUILD_TESTING=ON, full build including libs: asobi_root_environment (default value, setenv override, absent variable) and guest_environment pass. python tools/check_conventions.py --base origin/main passes; tools/pr_overlap.py was run against the branch (only closed predecessors #4274/#3959/#4565; no open PR provides this). The title itself was not rerun with this build.

Checklist

…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).
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 19, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 3965 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 5021 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 6084 core/libs/prx/libc/CMakeLists.txt
PR 6819 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7081 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7386 docs/dev/debt/libc.md
PR 7447 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7544 docs/dev/debt/libc.md
PR 7645 core/libs/prx/libc/CMakeLists.txt
PR 7648 docs/dev/debt/libc.md
PR 7851 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8150 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 8417 docs/dev/debt/libc.md
PR 8965 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 9087 docs/dev/debt/libc.md
PR 9340 docs/dev/debt/libc.md
PR 9371 docs/dev/debt/libc.md
PR 9447 docs/dev/debt/libc.md
PR 9466 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 9526 docs/dev/debt/libc.md
PR 9584 core/libs/prx/libc/CMakeLists.txt
PR 9677 docs/dev/debt/libc.md
PR 9761 docs/dev/debt/libc.md
PR 9773 core/libs/prx/libc/CMakeLists.txt
PR 9775 core/libs/prx/libc/CMakeLists.txt
PR 9798 core/libs/prx/libc/CMakeLists.txt
PR 9863 docs/dev/debt/libc.md
PR 9873 docs/dev/debt/libc.md
PR 9929 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 9935 docs/dev/debt/libc.md
PR 9964 docs/dev/debt/libc.md
PR 10002 docs/dev/debt/libc.md
PR 10007 docs/dev/debt/libc.md
PR 10113 docs/dev/debt/libc.md
PR 10158 docs/dev/debt/libc.md
PR 10165 docs/dev/debt/libc.md
PR 10200 docs/dev/debt/libc.md
PR 10226 docs/dev/debt/libc.md
PR 10234 docs/dev/debt/libc.md
PR 10245 docs/dev/debt/libc.md
PR 10250 docs/dev/debt/libc.md
PR 10253 docs/dev/debt/libc.md
PR 10265 docs/dev/debt/libc.md
PR 10270 docs/dev/debt/libc.md
PR 10274 docs/dev/debt/libc.md
PR 10315 docs/dev/debt/libc.md
PR 10321 docs/dev/debt/libc.md
PR 10325 docs/dev/debt/libc.md
PR 10328 docs/dev/debt/libc.md
PR 10345 docs/dev/debt/libc.md
PR 10349 docs/dev/debt/libc.md
PR 10397 docs/dev/debt/libc.md
PR 10405 docs/dev/debt/libc.md
PR 10506 docs/dev/debt/libc.md
PR 10510 docs/dev/debt/libc.md
PR 10512 docs/dev/debt/libc.md
PR 10565 docs/dev/debt/libc.md
PR 10569 docs/dev/debt/libc.md
PR 10749 docs/dev/debt/libc.md
PR 10780 docs/dev/debt/libc.md
PR 10987 docs/dev/debt/libc.md
PR 11109 docs/dev/debt/libc.md
PR 11172 docs/dev/debt/libc.md
PR 11260 docs/dev/debt/libc.md
PR 11262 docs/dev/debt/libc.md
PR 11266 docs/dev/debt/libc.md
PR 11332 docs/dev/debt/libc.md
PR 11621 docs/dev/debt/libc.md
PR 11624 core/libs/prx/libc/CMakeLists.txt
PR 11625 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 11628 core/libs/prx/libc/CMakeLists.txt
PR 11632 docs/dev/debt/libc.md
PR 11634 docs/dev/debt/libc.md
PR 11661 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 11664 docs/dev/debt/libc.md
PR 11689 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 11698 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 11724 docs/dev/debt/libc.md
PR 11726 docs/dev/debt/libc.md
PR 11793 docs/dev/debt/libc.md
PR 11831 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 11848 docs/dev/debt/libc.md
PR 11870 docs/dev/debt/libc.md
PR 11895 docs/dev/debt/libc.md
PR 11907 docs/dev/debt/libc.md
PR 11947 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12053 docs/dev/debt/libc.md
PR 12057 docs/dev/debt/libc.md
PR 12071 core/libs/prx/libc/CMakeLists.txt
PR 12122 docs/dev/debt/libc.md
PR 12146 core/libs/prx/libc/CMakeLists.txt
PR 12149 docs/dev/debt/libc.md
PR 12184 docs/dev/debt/libc.md
PR 12271 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12292 docs/dev/debt/libc.md
PR 12397 docs/dev/debt/libc.md
PR 12428 docs/dev/debt/libc.md
PR 12510 docs/dev/debt/libc.md
PR 12511 docs/dev/debt/libc.md
PR 12514 docs/dev/debt/libc.md
PR 12518 docs/dev/debt/libc.md
PR 12530 docs/dev/debt/libc.md
PR 12532 docs/dev/debt/libc.md
PR 12560 docs/dev/debt/libc.md
PR 12574 docs/dev/debt/libc.md
PR 12592 docs/dev/debt/libc.md
PR 12593 docs/dev/debt/libc.md
PR 12594 docs/dev/debt/libc.md
PR 12595 docs/dev/debt/libc.md
PR 12598 docs/dev/debt/libc.md
PR 12605 docs/dev/debt/libc.md
PR 12622 docs/dev/debt/libc.md
PR 12627 docs/dev/debt/libc.md
PR 12682 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12688 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12700 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12704 docs/dev/debt/libc.md
PR 12717 core/libs/prx/libc/CMakeLists.txt
PR 12777 core/libs/prx/libc/CMakeLists.txt
PR 12841 docs/dev/debt/libc.md
PR 12849 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 12882 core/libs/prx/libc/CMakeLists.txt
PR 12883 core/libs/prx/libc/CMakeLists.txt
PR 12884 core/libs/prx/libc/CMakeLists.txt
PR 12885 core/libs/prx/libc/CMakeLists.txt
PR 12886 core/libs/prx/libc/CMakeLists.txt
PR 12887 core/libs/prx/libc/CMakeLists.txt
PR 12888 core/libs/prx/libc/CMakeLists.txt
PR 12889 core/libs/prx/libc/CMakeLists.txt
PR 12890 core/libs/prx/libc/CMakeLists.txt
PR 12920 docs/dev/debt/libc.md
PR 12947 docs/dev/debt/libc.md
PR 12965 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 13119 docs/dev/debt/libc.md
PR 13186 docs/dev/debt/libc.md
PR 13303 core/libs/prx/libc/CMakeLists.txt
PR 13304 core/libs/prx/libc/CMakeLists.txt
PR 13305 core/libs/prx/libc/CMakeLists.txt
PR 13306 core/libs/prx/libc/CMakeLists.txt
PR 13307 core/libs/prx/libc/CMakeLists.txt
PR 13308 core/libs/prx/libc/CMakeLists.txt
PR 13310 core/libs/prx/libc/CMakeLists.txt
PR 13311 core/libs/prx/libc/CMakeLists.txt
PR 13312 core/libs/prx/libc/CMakeLists.txt
PR 13313 core/libs/prx/libc/CMakeLists.txt
PR 13314 core/libs/prx/libc/CMakeLists.txt
PR 13316 core/libs/prx/libc/CMakeLists.txt
PR 13317 core/libs/prx/libc/CMakeLists.txt
PR 13318 core/libs/prx/libc/CMakeLists.txt
PR 13319 core/libs/prx/libc/CMakeLists.txt
PR 13320 core/libs/prx/libc/CMakeLists.txt
PR 13378 core/libs/prx/libc/CMakeLists.txt
PR 13379 core/libs/prx/libc/CMakeLists.txt
PR 13380 core/libs/prx/libc/CMakeLists.txt
PR 13381 core/libs/prx/libc/CMakeLists.txt
PR 13382 core/libs/prx/libc/CMakeLists.txt
PR 13383 core/libs/prx/libc/CMakeLists.txt
PR 13385 core/libs/prx/libc/CMakeLists.txt
PR 13386 core/libs/prx/libc/CMakeLists.txt
PR 13387 core/libs/prx/libc/CMakeLists.txt
PR 13389 core/libs/prx/libc/CMakeLists.txt
PR 13390 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 13391 core/libs/prx/libc/CMakeLists.txt
PR 13392 core/libs/prx/libc/CMakeLists.txt
PR 13393 core/libs/prx/libc/CMakeLists.txt
PR 13394 core/libs/prx/libc/CMakeLists.txt
PR 13395 core/libs/prx/libc/CMakeLists.txt
PR 13449 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 13784 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 13793 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 13794 docs/dev/debt/libc.md
PR 13804 docs/dev/debt/libc.md
PR 13809 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 13828 docs/dev/debt/libc.md
PR 14020 docs/dev/debt/libc.md
PR 14085 docs/dev/debt/libc.md
PR 14212 docs/dev/debt/libc.md
PR 14235 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 14298 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 14326 docs/dev/debt/libc.md
PR 14585 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 14588 docs/dev/debt/libc.md
PR 14595 docs/dev/debt/libc.md
PR 14610 docs/dev/debt/libc.md
PR 14619 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 14620 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 14623 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 14799 core/libs/prx/libc/CMakeLists.txt
PR 14828 docs/dev/debt/libc.md
PR 14864 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 14878 docs/dev/debt/libc.md
PR 14915 docs/dev/debt/libc.md
PR 14955 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 15004 docs/dev/debt/libc.md
PR 15095 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/src/Environment.cpp
docs/dev/debt/libc.md
PR 15098 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 15099 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md

@github-actions github-actions Bot added libc build docs fix error Closes an issue (Fixes #N) labels Oct 19, 2026
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (authorship unchanged). One conflict in the test registration: your asobi_root_environment test sits alongside main's newer guest_dinkumware_atomics registration, both kept.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the two known main regressions (agc_driver_tessellation — Mesa, #5444; agc_driver_bda_device — #7584), neither from this PR.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7715
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is fd377744e.

@blawesom

Copy link
Copy Markdown
Contributor

Correction to the handoff above: the first push had a malformed CMakeLists merge (an unterminated if(WIN32) block from the conflict resolution — the fix is amended in, head is now 439b5d6dd). Also, the verification on the corrected head showed a third known main regression beyond the two in the original comment: agc_driver_image_table_vouched_lookups fails on RADV since the #6454 merge — bisected and filed as #7766, not from this PR. The handoff itself is green apart from the three known main regressions (#5444 Mesa, #7584 BDA, #7766 image-table vouch).

@adriadam10 adriadam10 self-assigned this Oct 19, 2026

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for carrying this. Two problems before it can land:

  • The root cause in #3480 says the opposite of what this PR assumes: "Serving ASOBI_ROOT through the guest environment alone does not help: the title does not expand the token itself", and the title passes /host/%ASOBI_ROOT%/target/data/... literally to the file API. The PR body says the title reads ASOBI_ROOT through getenv, with no source, and the title was not rerun with this build. Please show the title getting past SoundManager.cpp:306 with this change (log), or evidence (disassembly/import trace) that it calls getenv("ASOBI_ROOT").
  • The test only checks that getenv returns the value the PR seeds, so it would not catch the fix being ineffective. The app0 value comes from a homebrew convention and is not measured on the console (as the debt line itself says).

If the real behaviour is %VAR% handling at the /host translation layer, as #3480 suggests, that is a different change. Also core/libs/prx/libc/CMakeLists.txt conflicts with main (test registration); please rebase when you update.

@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (585075cb7, authorship unchanged). One CMake test-registration conflict with main's new guest_dinkumware_atomics tests, unioned (both blocks registered; the shared if(WIN32) closer duplicated so each block closes its own).

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; asobi_root_environment and guest_dinkumware_atomics both pass; full suite green apart from the four known main regressions (#5444 Mesa, #7584 BDA, #7766, #7784), none from this PR; conventions pass.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7715
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 3e221b62a.

@Felipebmaitan Felipebmaitan mentioned this pull request Oct 21, 2026
12 tasks done

@adriadam10 adriadam10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still blocked on the same point, now that the rebase is in:

  • The premise is unproven. #3480's root cause says serving ASOBI_ROOT through the guest environment alone does not help (the title passes /host/%ASOBI_ROOT%/target/data/... literally to the file API), and nothing in this PR or its thread shows the title calling getenv("ASOBI_ROOT"). Please attach either a log of the title getting past SoundManager.cpp:306 with this change, or an import trace/disassembly of the getenv call.
  • core/libs/tests/AsobiRootEnvironment.cpp only reads back the value the PR seeds, so it passes whether or not the fix helps the title. The app0 value follows a homebrew convention and is not measured on the console.
  • core/libs/prx/libc/CMakeLists.txt conflicts with main again (test registration); rebase when you update.

If the real behaviour is %VAR% handling at the /host translation layer, that is a different change.

This was referenced Oct 30, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 30, 2026
@lgqdaxia

lgqdaxia commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

The generic getenv/environ mismatch noted in the review now has a separate fix: PR #15095, following Discussion #11161. It makes libc use libkernel's exported environ table and preserves the string-lifetime behavior already on main from #12054. Its guest environment still starts empty; it does not establish the title/default-variable premise discussed here.

There is a real source overlap with #7715's initializer: your current patch seeds the older private vector, while the coherence change replaces that store with the shared table. If this proposal proceeds, its initialization changes will need to compose with that table rather than restore the separate vector. The title/default concerns raised in review remain separate. I have not run the combination or established a runtime prerequisite.

Do you have a preferred order? I can adapt the coherence change if yours lands first. No order is agreed at present.

AI-assisted: yes

This branch has not been deployed

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

Labels

build docs fix error Closes an issue (Fixes #N) libc needs rebase Conflicts with main, rebase needed unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ASTRO BOT (PPSA21564): SoundManager asserts defaultBusses.size() == 1 during start-up (main 1be0a7ce)

9 participants