fix(ui): load config before reading the path cvars it can set - #384
Open
Azkali wants to merge 1 commit into
Open
fix(ui): load config before reading the path cvars it can set#384Azkali wants to merge 1 commit into
Azkali wants to merge 1 commit into
Conversation
Member
|
Formatting looks alright. Can you send this to the development branch? |
Author
Sure no problem ! |
Azkali
force-pushed
the
fix/config-load-before-path-cvars
branch
from
July 22, 2026 05:41
f8f5eb0 to
0793608
Compare
ReXApp::SetupEnvironment() read game_data_root / user_data_root / update_data_root / cache_root / metadata_root via REXCVAR_GET at the top of the function, but rex::cvar::LoadConfig(config_path_) did not run until after PathConfig had already been built from those values. A value set in the TOML config therefore could not influence path resolution: the cvar still held its default (empty) when it was read. The visible result is that setting game_data_root in the config file has no effect and the app aborts with '--game_data_root was not provided.' -- after it has already initialised the presenter and created a swapchain, so the failure surfaces late and looks unrelated to config. The existing call carried the comment 'Load config FIRST so log cvars have final values', which is what it achieved for the log cvars further down, but it sat below every path cvar read. Resolve the default config path up front. It is derived purely from the executable folder and the app name, so it does not depend on any cvar and the ordering cannot become circular. OnConfigurePaths() may still redirect config_path, so a second load is kept for that case only, guarded on the path having actually changed to avoid applying the same file twice.
Azkali
force-pushed
the
fix/config-load-before-path-cvars
branch
from
July 22, 2026 05:44
0793608 to
c82f6cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #383.
Summary
ReXApp::SetupEnvironment()read the four path cvars (game_data_root,user_data_root,update_data_root,cache_path) and baked them intoPathConfigbeforerex::cvar::LoadConfig()ran, so a value set in the TOML could never influence path resolution — the cvar still held its empty default at the moment it was read.This resolves the default config path up front and loads it before those reads.
Why this is safe
The default config path is
exe_dir / (GetName() + ".toml")— derived purely from the executable folder and the app name, with no dependency on any cvar. So loading it first cannot become circular, which is presumably why it was placed later in the first place.OnConfigurePaths()may still redirectconfig_path, so the existing load is kept for exactly that case, now guarded on the path having actually changed to avoid applying the same file twice.Ordering, before and after
PathConfig)game_data_rootetc.OnConfigurePathschanged itThe comment that was on line 121 (
// Load config FIRST so log cvars have final values) was accurate for the logging setup below it, but the call sat under every path cvar read — so "FIRST" only held relative to logging.Test plan
e8ce24f; the bug is platform-independent (no arch-specific behaviour involved).game_data_rootset in the TOML is now honoured with no command-line argument.--game_data_rooton the command line still wins where both are present, and that a config redirected byOnConfigurePathsstill applies.Notes
Independent of the aarch64 work in #381/#382 — this one reproduces anywhere, no special hardware needed. Submitted as its own issue + PR per the one-at-a-time request.