[PR #419] [CLOSED] TEST-CUBE-WINPATH: the cube semantic test cannot start llvm-mc when LLVM_MC is a Windows path #470

Closed
opened 2026-11-26 20:17:59 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/419
Author: @fiestorra
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: carry/cube-winpath


📝 Commits (1)

  • 060c3c6 semantic test: split LLVM_MC with the repository's own helper, not shlex

📊 Changes

1 file changed (+5 additions, -2 deletions)

View changed files

📝 tests/semantic/test_image_cube_store_glc.py (+5 -2)

📄 Description

Claimed in the coordination issue as: TEST-CUBE-WINPATH (claim comment).

What this changes

tests/semantic/test_image_cube_store_glc.py :52-57 has its own llvm_mc_cmd(), and it turns LLVM_MC into an argv with shlex.split(). shlex is POSIX word splitting: it treats a backslash as an escape, so a Windows path loses its separators. Set the variable the way docs/testing.md :16-21 tells Windows users to set it (scripts\build_llvm_mc.ps1 builds a native llvm-mc.exe and sets LLVM_MC for you) and the helper returns something like C:UsersIsegurav.leonida…llvm-mc.exe, subprocess.run raises FileNotFoundError inside LlvmMcRoundTrip, and the test errors instead of running. The @unittest.skipUnless(llvm_mc_cmd() is not None, …) guard cannot help: it only checks whether a value came back, not whether it names a program.

tools/mc_command.py is the helper every other tool in this tree already uses, and its split_command() docstring is "Split a command line without eating the backslashes of a Windows path (POSIX shlex would)". This file is the only one in the repository carrying a private copy. The change is to call mc_command.mc_command(env) there and keep the same rule for the skip case (llvm-mc on PATH, or skip when nothing is available). import support at :21 already puts tools/ on sys.path, which is how rdna2spirv is imported in the same file.

Evidence on ece4ba5b3

Head 060c3c6cf, one commit, tests/semantic/test_image_cube_store_glc.py only (+7 / −2). The tool used is the local llvm-mc.exe from scripts/build_llvm_mc.ps1 (LLVM 21.1.8), spirv-as/spirv-val from Vulkan SDK 1.4.363.0, CPython 3.13.14, Windows build 26300. No GPU is involved.

  • LLVM_MC=C:\Users\Isegurav\.leonida\llvm-mc\llvm-mc.exe, llvm-mc not on PATH — clean ece4ba5b3: Ran 9 tests in 0.550s / FAILED (errors=1). This branch: Ran 9 tests in 0.789s / OK.
  • llvm-mc on PATH, LLVM_MC unset — ece4ba5b3 OK (measured in the same session), this branch: Ran 9 tests in 0.774s / OK. Unchanged.
  • neither available — ece4ba5b3: Ran 9 tests in 0.554s / OK (skipped=1). This branch: Ran 9 tests in 0.552s / OK (skipped=1). The skip behaviour is what it was.
  • py -3.13 -I -m unittest discover -s tests -p "test_docs_*.py": Ran 47 tests in 23.944s / OK on this branch (and 47 / OK on clean ece4ba5b3 measured earlier in the same session).

This is the test my own old #9778 added, so the broken helper is mine and this is the follow-up, not a criticism of anyone else's work. Written with an AI assistant.


🔄 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/419 **Author:** [@fiestorra](https://github.com/fiestorra) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `carry/cube-winpath` --- ### 📝 Commits (1) - [`060c3c6`](https://github.com/ubiquitarianism/leonida/commit/060c3c6cf248960292cadba6cf8464312de88916) semantic test: split LLVM_MC with the repository's own helper, not shlex ### 📊 Changes **1 file changed** (+5 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/semantic/test_image_cube_store_glc.py` (+5 -2) </details> ### 📄 Description Claimed in the coordination issue as: `TEST-CUBE-WINPATH` ([claim comment](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7122401986)). ### What this changes `tests/semantic/test_image_cube_store_glc.py` :52-57 has its own `llvm_mc_cmd()`, and it turns `LLVM_MC` into an argv with `shlex.split()`. `shlex` is POSIX word splitting: it treats a backslash as an escape, so a Windows path loses its separators. Set the variable the way `docs/testing.md` :16-21 tells Windows users to set it (`scripts\build_llvm_mc.ps1` builds a native `llvm-mc.exe` and sets `LLVM_MC` for you) and the helper returns something like `C:UsersIsegurav.leonida…llvm-mc.exe`, `subprocess.run` raises `FileNotFoundError` inside `LlvmMcRoundTrip`, and the test errors instead of running. The `@unittest.skipUnless(llvm_mc_cmd() is not None, …)` guard cannot help: it only checks whether a value came back, not whether it names a program. `tools/mc_command.py` is the helper every other tool in this tree already uses, and its `split_command()` docstring is "Split a command line without eating the backslashes of a Windows path (POSIX shlex would)". This file is the only one in the repository carrying a private copy. The change is to call `mc_command.mc_command(env)` there and keep the same rule for the skip case (`llvm-mc` on `PATH`, or skip when nothing is available). `import support` at :21 already puts `tools/` on `sys.path`, which is how `rdna2spirv` is imported in the same file. ### Evidence on `ece4ba5b3` Head `060c3c6cf`, one commit, `tests/semantic/test_image_cube_store_glc.py` only (+7 / −2). The tool used is the local `llvm-mc.exe` from `scripts/build_llvm_mc.ps1` (LLVM 21.1.8), `spirv-as`/`spirv-val` from Vulkan SDK 1.4.363.0, CPython 3.13.14, Windows build 26300. No GPU is involved. * `LLVM_MC=C:\Users\Isegurav\.leonida\llvm-mc\llvm-mc.exe`, `llvm-mc` not on `PATH` — clean `ece4ba5b3`: `Ran 9 tests in 0.550s` / `FAILED (errors=1)`. This branch: `Ran 9 tests in 0.789s` / `OK`. * `llvm-mc` on `PATH`, `LLVM_MC` unset — `ece4ba5b3` `OK` (measured in the same session), this branch: `Ran 9 tests in 0.774s` / `OK`. Unchanged. * neither available — `ece4ba5b3`: `Ran 9 tests in 0.554s` / `OK (skipped=1)`. This branch: `Ran 9 tests in 0.552s` / `OK (skipped=1)`. The skip behaviour is what it was. * `py -3.13 -I -m unittest discover -s tests -p "test_docs_*.py"`: `Ran 47 tests in 23.944s / OK` on this branch (and 47 / OK on clean `ece4ba5b3` measured earlier in the same session). This is the test my own old #9778 added, so the broken helper is mine and this is the follow-up, not a criticism of anyone else's work. Written with an AI assistant. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:17:59 +01:00
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#470
No description provided.