Reject persistent data directories inside the cache #194
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/194"
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 avatarmanz/VIctory-7900XTX. Originally posted by feanorsun on 2026-11-26T11:11:14Z.
Persistent saves can be lost when a user clears the cache. This change checks the final
data_dirandcache_dirafter each setting has been resolved from the environment, the configuration file, or its default. It rejects equality and descendants. Siblings such ascacheandcache-old, and a cache below the data directory, remain valid.The first commit is an independent port of Luiz Neves's original patch, cherry-picked with
-xfromc7cf0baafc1cd3f465ae7a4208758c8423fafd71. The same configuration change appeared in the closed upstream PR #103. Original PR and diff · Upstream PR #103The follow-up covers both directions of a
VICTORY_DATA_DIRoverride. For directories that do not exist yet, it applies Win32 path spelling rules, preserves explicit verbatim paths, and checks the parent directory's case-sensitivity setting when the two spellings differ only in case. The Windows bindings were already in the workspace lockfile.Windows verification
cache\savesreturned a successful configuration...paths, overrides into and out of the cache, similarly named siblings, and ordinary versus verbatim Windows paths.Cargo used local dependencies offline. The regressions used temporary directories and injected environment values. Validation was limited to CPU configuration tests.
Imported from avatarmanz/VIctory-7900XTX. Originally posted by kilolimaVI on 2026-11-26T19:16:23Z.
Tested locally on Windows 11 (Ryzen 7 8845HS / Radeon 780M, pinned toolchain 1.98.1):
cargo test -p victory-core --locked: 19 passed, 0 failed (includes the six new data/cache directory tests)cargo clippy -p victory-core --all-targets --all-features --locked -- -D warnings: cleanCargo.lockchange resolves with--lockedBranch is 14 commits behind main; tested as-is.
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.