[PR #803] rdna2spirv: restore write mode before unlink on replace failure and publish mode on Windows in write_index (RDNA2SPIRV-INDEX-STAGE-CLEANUP) #842

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

📋 Pull Request Information

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

Base: main ← Head: fix/rdna2spirv-index-stage-cleanup


📝 Commits (1)

  • 1003de3 rdna2spirv: restore write mode before unlink on replace failure and publish mode on Windows in write_index (RDNA2SPIRV-INDEX-STAGE-CLEANUP)

📊 Changes

2 files changed (+35 additions, -2 deletions)

View changed files

📝 tests/test_rdna2spirv_index_write.py (+30 -0)
📝 tools/rdna2spirv.py (+5 -2)

📄 Description

In tools/rdna2spirv.py, write_index creates a temporary file and previously skipped applying published_mode on Windows because os.unlink in the except BaseException block fails with PermissionError (WinError 5) if replace_retry fails on read-only destinations.

Align with the repository standard:

  1. In except BaseException, restore write permissions (try: os.chmod(tmp, 0o600); except OSError: pass) before calling os.unlink.
  2. Apply published_mode(path) unconditionally so Windows outputs receive proper permissions instead of keeping NamedTemporaryFile's default 0o600 mode.
  3. Add synthetic regression tests verifying PermissionError handling and Windows published_mode application.

Tests pass (11/11 in test_rdna2spirv_index_write.py), scripts/check_no_game_data.py passes cleanly.

agent: yes
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/803 **Author:** [@trigger337](https://github.com/trigger337) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/rdna2spirv-index-stage-cleanup` --- ### 📝 Commits (1) - [`1003de3`](https://github.com/ubiquitarianism/leonida/commit/1003de325474f9f0fe774074fa996b79e4e2367e) rdna2spirv: restore write mode before unlink on replace failure and publish mode on Windows in write_index (RDNA2SPIRV-INDEX-STAGE-CLEANUP) ### 📊 Changes **2 files changed** (+35 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_rdna2spirv_index_write.py` (+30 -0) 📝 `tools/rdna2spirv.py` (+5 -2) </details> ### 📄 Description In `tools/rdna2spirv.py`, `write_index` creates a temporary file and previously skipped applying `published_mode` on Windows because `os.unlink` in the `except BaseException` block fails with `PermissionError` (WinError 5) if `replace_retry` fails on read-only destinations. Align with the repository standard: 1. In `except BaseException`, restore write permissions (`try: os.chmod(tmp, 0o600); except OSError: pass`) before calling `os.unlink`. 2. Apply `published_mode(path)` unconditionally so Windows outputs receive proper permissions instead of keeping `NamedTemporaryFile`'s default `0o600` mode. 3. Add synthetic regression tests verifying `PermissionError` handling and Windows `published_mode` application. Tests pass (11/11 in `test_rdna2spirv_index_write.py`), `scripts/check_no_game_data.py` passes cleanly. agent: yes 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#842
No description provided.