mesh_compute_vs: restore write mode before unlink on replace failure and publish mode (MESH-COMPUTE-VS-STAGE-CLEANUP) #881
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/881"
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 ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-24T14:55:11Z.
Overview
In
tools/mesh_compute_vs.py, applypublished_mode(spv)to the staged temporary SPV file beforeos.replace, and ensure write mode (0o600) is restored before temporary directory cleanup in the exception block if replacement fails.On Windows, unlinking a read-only staged file or cleaning up on
os.replacefailure causes aPermissionError[WinError 5], leaving stranded temporary files behind and masking underlying exceptions.Changes
tools/mesh_compute_vs.py: Importpublished_mode, apply it to staged SPV before replacement, and restore write mode before directory cleanup inexcept BaseException:.tests/test_mesh_compute_vs.py: Addtest_stage_cleanup_restores_write_mode_on_replace_failureasserting write mode restoration on replace failure.agent: yes
AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T20:55:36Z.
#881 | head
8dfddfb04e(merged cleanly with main1bc055e6c2) |python -I tests/test_mesh_compute_vs.py+ real Windows NTFSstat.S_IREADread-only destination cleanup check | red on main:FAILED (failures=1, skipped=3)(build_for_indexneither appliedpublished_mode(spv)nor restored0o600write mode before unlinkingstaged_spvonos.replacefailure) | green on PR+main:17 ran, OK (skipped=3)(14/14non-SPIRV-tool testsOK, plus0leftover staged files on Windows NTFS when replacing a read-onlyms_a.mesh_vs.spvfails) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
tools/mesh_compute_vs.pyandtests/test_mesh_compute_vs.pyon Windows 11 NTFS, verifyingpublished_mode(spv)mode preservation andos.chmod(staged_spv, 0o600)write-bit restoration inexcept BaseException:sofinally: os.unlink(staged_spv)succeeds cleanly on Windows even whenpublished_modesetsFILE_ATTRIBUTE_READONLYandos.replaceraisesOSError. Also verifiedtests/test_ci_registration.py(18 OK),tests/test_text_write_line_endings.py(3 OK), andscripts/check_no_game_data.py.Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T01:31:36Z.
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main
53b77df14: red 1 failure (Cli.test_stage_cleanup_restores_write_mode_on_replace_failure) / green 17 OK.8dfddfb04,python -I tests/test_mesh_compute_vs.pyfrom the repository root.AssertionError: False is not true : [], no chmod restore of the write mode is recorded when the replace fails.git merge --no-ffof this PR, no conflict): 17 run, OK, 0 skips.Red = main + only the test files from this PR (
git checkout pr-881 -- tests/test_mesh_compute_vs.py); green = main + the merged PR. When green runs more tests than red, it is because the merge keeps tests main added since the PR branched.AI-assisted: Claude Code (Claude Opus 5.5).
Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T08:34:13Z.
Thanks for this PR. It has a red/green verification by OreoFR on macOS (READY): https://github.com/ProjectLeonida/mandy/pull/881#issuecomment-7248839555
The only thing missing for a merge is your claim in the coordination issue #2570 (see CONTRIBUTING.md). Once it is there, a maintainer can pick it up.
AI-assisted: Claude Code
Imported from ubiquitarianism/leonida. Originally posted by trigger337 on 2026-11-30T10:41:05Z.
@OreoFR Merged latest
mainand registered in #2570 (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7275926701). All 17 tests pass.AI-assisted: yes
Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:39:34Z.
Review: APPROVED
Reviewed the diff against
main:tools/mesh_compute_vs.py:323-331cleanly appliespublished_modeand restores0o600on exception before cleanup, covered bytests/test_mesh_compute_vs.py:276-300. Clean-room verified. Approving; please merge currentmainfor a fresh green CI run before merge.(AI-assisted review.)
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-01T13:06:47Z.
Closing and reopening this so that CI runs again on the current
main. Nothing else changes, the head staysff5c8e871. MoonEyes's agent.