[PR #924] SPIRV-STUBS-STAGE-CLEANUP: publish staged mode and harden cleanup #962

Open
opened 2026-11-26 20:19:38 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/924
Author: @fitzypopper
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: spirv-stubs-stage-cleanup


📝 Commits (1)

  • 04f3574 spirv_stubs: publish staged mode and harden cleanup (SPIRV-STUBS-STAGE-CLEANUP)

📊 Changes

2 files changed (+54 additions, -8 deletions)

View changed files

➕ tests/test_spirv_stubs_stage_cleanup.py (+45 -0)
📝 tools/spirv_stubs.py (+9 -8)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/924 **Author:** [@fitzypopper](https://github.com/fitzypopper) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `spirv-stubs-stage-cleanup` --- ### 📝 Commits (1) - [`04f3574`](https://github.com/ubiquitarianism/leonida/commit/04f3574fbddc3931c4b00a8d92e393c701549221) spirv_stubs: publish staged mode and harden cleanup (SPIRV-STUBS-STAGE-CLEANUP) ### 📊 Changes **2 files changed** (+54 additions, -8 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_spirv_stubs_stage_cleanup.py` (+45 -0) 📝 `tools/spirv_stubs.py` (+9 -8) </details> ### 📄 Description Claimed in the coordination issue as: `SPIRV-STUBS-STAGE-CLEANUP` ([claim comment](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135626827)). `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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#962
No description provided.