Keep empty directory variables from redirecting saves and caches #596
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound!596
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@shiaho777 on GitHub · 2026-12-04 13:06 UTC · original
shiaho777:fix/empty-user-dirs→main· +36 −11 · 1 files · 1 commits · openWith 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.@fromthemoonx on GitHub · 2026-12-04 16:14 UTC · original
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.