SPIRV-STUBS-STAGE-CLEANUP: publish staged mode and harden cleanup #924

Open
github-bot wants to merge 1 commit from github-bot/gh-924 into main AGit
Owner

@⁠fitzypopper on GitHub · 2026-11-24 15:12 UTC · original
fitzypopper:spirv-stubs-stage-cleanup → main · +54 −8 · 2 files · 1 commits · open

Claimed in the coordination issue as: SPIRV-STUBS-STAGE-CLEANUP (claim comment).

tools/spirv_stubs.py copied the target's mode only on POSIX (shutil.copymode), so staged stubs published on Windows lost the destination's permission bits. Its failure path also removed the staged file without making it writable first, which can mask the original error when the staged file carries a read-only mode. This uses published_mode(target) on every OS and, on failure, chmods the staged file to 0o600 before removing it, with cleanup errors suppressed.

New tests/test_spirv_stubs_stage_cleanup.py simulates a Windows publication to check the mode is applied, and patches _replace_stub to fail to check the staged file is made writable and removed. Both fail on origin/main and pass with this change. The existing 15 test_spirv_stubs.py tests still pass.

No game data: synthetic index only. check_no_game_data.py and the line-ending test pass.

AI-assisted: yes.

**@⁠fitzypopper** on GitHub · 2026-11-24 15:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/924) `fitzypopper:spirv-stubs-stage-cleanup` → `main` · +54 −8 · 2 files · 1 commits · open Claimed in the coordination issue as: `SPIRV-STUBS-STAGE-CLEANUP` ([claim comment](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14)). `tools/spirv_stubs.py` copied the target's mode only on POSIX (`shutil.copymode`), so staged stubs published on Windows lost the destination's permission bits. Its failure path also removed the staged file without making it writable first, which can mask the original error when the staged file carries a read-only mode. This uses `published_mode(target)` on every OS and, on failure, chmods the staged file to `0o600` before removing it, with cleanup errors suppressed. New `tests/test_spirv_stubs_stage_cleanup.py` simulates a Windows publication to check the mode is applied, and patches `_replace_stub` to fail to check the staged file is made writable and removed. Both fail on `origin/main` and pass with this change. The existing 15 `test_spirv_stubs.py` tests still pass. No game data: synthetic index only. `check_no_game_data.py` and the line-ending test pass. AI-assisted: yes.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:28:32 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 21:29 UTC · original

Reviewed 04f3574: staged stubs now take published_mode(target) on every OS and the failure path chmods 0o600 before removing, matching the repo's staging conventions. I ran test_spirv_stubs (15 OK, 1 nt skip), the new test file, test_shader_build_fallbacks and test_shader_link_check on both trees, plus a tip-overlap integration run: the 2 new tests fail on main and pass with the change, everything else stays green. Filesystem probes show no behaviour change on Linux by design; the Windows path is covered by the mocked tests. No findings; nit: shutil is now unused in spirv_stubs.py. AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 21:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/924#issuecomment-7175155683) Reviewed 04f3574: staged stubs now take published_mode(target) on every OS and the failure path chmods 0o600 before removing, matching the repo's staging conventions. I ran test_spirv_stubs (15 OK, 1 nt skip), the new test file, test_shader_build_fallbacks and test_shader_link_check on both trees, plus a tip-overlap integration run: the 2 new tests fail on main and pass with the change, everything else stays green. Filesystem probes show no behaviour change on Linux by design; the Windows path is covered by the mocked tests. No findings; nit: shutil is now unused in spirv_stubs.py. AI-assisted review. **Recommendation:** Merge
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/924/head:github-bot/gh-924'
git switch 'github-bot/gh-924'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-924'
git switch 'github-bot/gh-924'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-924'
git switch 'github-bot/gh-924'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-924'
git switch 'main'
git merge --squash 'github-bot/gh-924'
git switch 'main'
git merge --ff-only 'github-bot/gh-924'
git switch 'main'
git merge 'github-bot/gh-924'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.