Keep empty directory variables from redirecting saves and caches #596
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/596"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from readmet3xt-lab/foxhound. Originally posted by shiaho777 on 2026-12-04T13:06:45Z.
With an empty
LOCALAPPDATA, the default cache and save roots resolve to the relative pathsvictory/cacheandvictory/data. Launching from a different directory then selects a different save location. An emptyXDG_CACHE_HOMElikewise shadows an available home directory.Use the existing nonempty path lookup for the three fallback variables. If every fallback is empty, report the existing configuration error. Explicit cache and data paths keep their precedence.
Verified with
cargo test --locked -p victory-core(15 tests), Clippy for all targets in the crate, andcargo xtask policy. The regression tests exercise both an available home directory and an entirely empty environment.Imported from readmet3xt-lab/foxhound. Originally posted by fromthemoonx on 2026-12-04T16:14:41Z.
Works on native Windows: an empty
LOCALAPPDATAno longer puts saves and caches in whatever folder the program was started from.victory config,mainagainst this PR, real debug builds. Only the variables named are set:mainLOCALAPPDATAsetLOCALAPPDATAempty,HOMEsetvictory\cache,victory\dataHOME\.cache\victoryXDG_CACHE_HOMEempty,HOMEsetHOME\.cache\victoryLOCALAPPDATAempty, nothing elseVICTORY_*_DIRgivenTested at
a9578a45, which sits directly on currentmain(5e44415b). Windows 11 Pro, Ryzen 7 5700X, RTX 3060 12 GB.cargo test --workspace --locked --no-fail-fast: 1402 passed, 0 failed, 51 ignored.--all-features) andcargo xtask policy: clean.XDG_CACHE_HOMEaccepted, emptyHOMEaccepted), and at least one of the two new tests failed each time.Outside this PR, from reading only:
load_mods(apps/victory/src/main.rs),installed_place(victory-profile) andfile_physical_dir(victory-hle) also take an emptyLOCALAPPDATAas a folder.load_modsis the one I'd look at first, since it would load DLLs from avictory\modsunder the current folder. Fine as a separate change.Not tested: starting a title, the launcher, Linux or Wine.
AI use: Claude Code (Claude Opus 5.5) ran the tests, read the diff and wrote this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.