Keep unrelated files when clearing a shared cache folder #598
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/598"
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:09:46Z.
In a shared cache directory, Clear old selects a directory such as
shaders/t-screenshotsand a file such asshaders/.tmp-notesfor deletion. Preparing everything again also selectsimages/victory-image-backup.dll. A directory selected by Clear old is removed together with its contents.Check for the 16-digit hex fingerprints used by the shader and image writers and for both decimal fields of a staging filename. A display-profile directory is selected as a unit only when it contains at least one image and every entry can be identified as a generated image.
The cache tests now include unrelated names alongside real cache entries. All three tests passed in the Windows test binary under Wine. I also ran
victory caches --deletein temporary directories in its default,--start-over, and--start-over --everythingmodes and checked the surviving files. Windows-target Clippy andcargo xtask policypassed.Imported from readmet3xt-lab/foxhound. Originally posted by fromthemoonx on 2026-12-04T15:42:46Z.
Works on native Windows: nothing that isn't the layer's is deleted any more, and everything the layer writes still goes.
victory caches --delete,mainagainst this PR, on the same made-up cache folder (debug builds):mainalso deleted--oldert-screenshots,t-with 15 and with 17 hex digits,.tmp-notes,.tmp-12-notes--start-over.tmp-notes,.tmp-12-notes--start-over --everythingvictory-image-backup.dll,victory-image-<16 hex>-old.dll, anative-backupsfolder withvictory-image-mine.dllin itThe layer's own entries went or stayed the same on both sides in every mode. A junction named
t-aaaaaaaaaaaaaaaawas left alone by both.I also checked the new patterns against the code that writes the names (
translator_stamp,create_tempfile_in,PreparedImage::file_name), at this head and at the tags v0.8.3 to v0.8.3.5: all of them fit, so leftovers of those releases are still found.One small difference:
--everythingnow leaves an emptynative-*folder, whichmainremoved. Harmless as far as I can see.Tested:
9926cb44, which is on top of currentmain(5e44415b). Windows 11, RTX 3060 12 GB, Ryzen 7 5700X, 16 GB RAM.cargo test --workspace --locked: 1400 passed, 0 failed, 51 ignored, the same counts asmainhere.cachestests, 3 more times: pass.t-fingerprint,.tmp-decimals, image fingerprint, empty folder, case of the current folder): the tests fail each time.Not tested: the launcher's buttons, a cache folder from real play, Clippy.
AI use: tested and written up with Claude Code (Claude Opus 5.5).
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.