rdna2spirv: restore write mode before unlink on replace failure and publish mode on Windows in write_index (RDNA2SPIRV-INDEX-STAGE-CLEANUP) #803
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!803
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/rdna2spirv-index-stage-cleanup"
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?
Pull request successfully merged and closed
In
tools/rdna2spirv.py,write_indexcreates a temporary file and previously skipped applyingpublished_modeon Windows becauseos.unlinkin theexcept BaseExceptionblock fails withPermissionError(WinError 5) ifreplace_retryfails on read-only destinations.Align with the repository standard:
except BaseException, restore write permissions (try: os.chmod(tmp, 0o600); except OSError: pass) before callingos.unlink.published_mode(path)unconditionally so Windows outputs receive proper permissions instead of keepingNamedTemporaryFile's default0o600mode.PermissionErrorhandling and Windowspublished_modeapplication.Tests pass (11/11 in
test_rdna2spirv_index_write.py),scripts/check_no_game_data.pypasses cleanly.agent: yes
AI-assisted: yes
Reviewed on native Windows 11 (Python 3.14.0) and on WSL (Python 3.14.4). The diff only touches write_index; translation is unaffected.
Two notes:
AI-assisted review (Claude Code).
Approving. Merged into current main (9f9a7c5) with no conflicts.
tests/test_rdna2spirv_index_write.pypasses (11 tests), and the full translator suite gives 491 files / 6,312 tests with onlytest_int32_to_f64failing, the same baseline failure as main here (Linux, Python 3.13).On Windows
os.chmodonly toggles the read-only bit, so applyingpublished_modethere is harmless. On the failure path, making the temp file writable again beforeunlinkis what lets a read-only temp be removed on Windows, and theOSErrorguard keeps cleanup best-effort.AI-assisted (Claude).
#803 | head
1003de325474f9f0fe774074fa996b79e4e2367e|python3 -I tests/test_rdna2spirv_index_write.py -v| red: 11 run, 2 failures (Linux), 11 run, 1 failure, 1 skipped (Windows) | green: 11 passed (Linux), 10 passed, 1 skipped (Windows) | Red → greenAlso tested native Windows publication and failure cleanup. The POSIX-only permission-bits check ran on Linux and was skipped on Windows.
Additional commands
py -3.12 -I tests/test_rdna2spirv_index_write.py -vBase
3bd936ecd98995bca3e1da83d5e28d2343001aefwas merged into the recorded PR head for the second run. Ubuntu 26.04.1 (WSL2), Python 3.14.4. Native runs used Windows 11, Python 3.12.10. Counts include unittest subtest events where applicable. AI-assisted with OpenAI Codex. Batch claim.Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)