mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 23:25:53 +01:00
[PR #2280] tools/spirv_stubs.py: preflight stub targets and harden CLI parsing #2284
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2284
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2280
Author: @kirigayakazima
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/spirv-stubs-safety📝 Commits (1)
fcedc33tools/spirv_stubs.py: preflight stub targets and harden CLI parsing📊 Changes
2 files changed (+50 additions, -1 deletions)
View changed files
📝
tests/test_spirv_stubs.py(+39 -0)📝
tools/spirv_stubs.py(+11 -1)📄 Description
Claimed in the coordination issue as: SPIRV-STUBS-CLI-RECURSION-AND-TARGET-DIR-GUARD (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7191999362)
What and why
<spirv dir>/stubs(not a non-directory file) and every planned<stub>.spvtarget path (not a pre-existing directory) upfront ingenerate_for_index()(tools/spirv_stubs.py) before creating directories or writing any stub so a partial stub set is never emitted on collision.-*) and blank<spirv dir>arguments with clear errors inmain(argv=None).RecursionErroralongside(OSError, ValueError)when callingjson.load()on deeply nestedindex.jsoninputs.tests/test_spirv_stubs.pycovering unknown flags, blank arguments,RecursionErrorhandling, pre-existing target directory collision aborting before writing other stubs, and non-directorystubspath rejection.Tested
python -I tests/test_spirv_stubs.py -v: 19 tests (18 passed, 1 skipped on Windows:test_rebuild_preserves_existing_mode, POSIX-only). Detachedupstream/mainbaseline with the updated test file fails with 4 failures and 3 errors.python -I tests/test_ci_registration.py: 16 passed.python -I tests/test_text_write_line_endings.py: 3 passed.python -I scripts/check_no_game_data.py,python -I -m compileall -q tools/spirv_stubs.py tests/test_spirv_stubs.py, andgit diff --cached --check: passed.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.