WIP: fix(dev): the shared shader store takes a grown cache on Windows: the read-only file it replaces is made writable first #2825
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2825
Loading…
Reference in a new issue
No description provided.
Delete branch "llun/Longshot:fix/mod-api-shader-store-windows"
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?
Summary
For #2822 (into
mod-api). The shared shader store thatscripts/devtools/shadercache.pykeeps fordev.pykeeps its files read-only (0o444).publishwrites a grown cache to a temporary file and moves it over the store's copy. Windows won't replace a read-only file (os.replace:PermissionError: [WinError 5] Access is denied). The cleanup then fails the same way on the temporary file, whichpublishhad also made read-only, so a base's second publish on Windows stops with that error and leaves a.tmpfile in the store. This removes the read-only mark from the store's old copy before the move on Windows, and from the temporary file before removing it. Linux is unchanged.Read first:
publishinscripts/devtools/shadercache.py.Testing
Tested: Windows 11,
mise run test -- test_shader_store. The check's existing case, "a grown file replaces the store's", fails onmod-api@eaf4a48bon Windows (thePermissionErrorabove, fromos.replaceand thenos.unlink) and passes here. It passes on Linux (WSL Ubuntu 24.04) both before and after.mise run lintpasses.Still to test: None.
Measurements
Verdict: fixed. A grown cache replaces the store's read-only copy on Windows: the check fails on
mod-apiand passes here.Baseline:
mod-api(#2822's head), the branch this PR goes into: the bug is there, not onmain.Setup: Windows 11,
mise run test -- test_shader_store. The game and the builds are not affected: only the development tool's file move changes.eaf4a48b8b5d81b3tests/test_shader_store.py, WindowsPermissionError: [WinError 5] Access is denied(os.replace, thenos.unlinkof the read-only temporary)tests/test_shader_store.py, Linux (WSL Ubuntu 24.04)Risks
The sandbox: not touched. This is
dev.py's shared shader store on a developer's PC. The confined game's grants are unchanged, and the store's files stay read-only after the move.Only
dev.py's shared shader store on Windows changes. The store's new copy is still read-only after the move. A revert is enough. Players notice nothing.Checklist
Ready for review
mod-api(#2822's head); the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). (This check passes. The whole suite onmod-apihas Windows-only failures, which another PR intomod-apifixes.)main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here. (The existing check fails onmod-apion Windows.)Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Possibly related, for context:
Measurements: the check's result before (mod-api @
9e6b9c57, fails on Windows) and after (5b3107f7, passes; Linux passes both), with a Baseline line, as standards.md's Measurements asks of a fix.5b3107f78aac99f738e5Rebased onto mod-api's new squash
eaf4a48b(the same tree as9e6b9c57, which this branch was on): the diff is this PR's own commits again. The checks and runs above hold as they are (the tree under them is unchanged); the description's commits are the new ones.Risks now says how this change stands with the sandbox (what it touches, and why the confined game reaches nothing more).
ac99f738e51299b88735Rebased onto mod-api's newest (
4cc50ca1: main's newest merged in), with no conflict; this PR's own checks were run again on the rebased head and pass as before. The merge touched none of this PR's files (#2827: only a comment in host/hos_main.c, far from its change), so the measurements and runs above hold; the After commit is the rebased head.1299b88735755aa273c6Rebased onto
mod-api@816d2354(#2837, headless shots of the mods' UI), now755aa273. No conflict, and the diff is the same as before (samegit patch-id). #2837 touches none of this PR's files.755aa273c614db9da8e814db9da8e88b5d81b3bcRebased onto
mod-api@c5e5b676: it was re-squashed onto main @46291934(#2833) twice today (cdbb8551, thenc5e5b676), which made this PR show main's and the whole mod API's diff. Now8b5d81b3, the same diff as before (samegit patch-id), no conflict. The changes underneath touch none of this PR's files, so its checks still hold.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.