Skip to content

Runtime build: the M2 formats test's shader rule passes LEONIDA_SPIRV_TOOLS, not PATH - #3210

Merged
ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
AC-Storm-YT:build/m2-formats-spirv-tools
Nov 22, 2026
Merged

ItsNotRexed merged 1 commit into
ItsNotRexed:mainfrom
AC-Storm-YT:build/m2-formats-spirv-tools

Conversation

@AC-Storm-YT

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as a new BUILD item: #3047 (comment)

What and why

On main, a Windows build of runtime/ with llvm-mc configured stops at "Translating vs_m2, ps_m2 and ps_m2_array for the M2 formats test" with "no such file or directory" (MSB8066).

The rule added with the M2 formats test (#1996, runtime/CMakeLists.txt:1335) runs build.py through cmake -E env "LLVM_MC=..." "PATH=${LEONIDA_SPIRV_TOOLS_NATIVE};$ENV{PATH}". The ;s make that string a CMake list, so on Windows each PATH entry reaches cmake -E env as its own argument; the generated project shows "PATH=C:\VulkanSDK\...\Bin";"C:\VulkanSDK\...\Bin";"C:\Program Files\...", and cmake -E env tries to run the second one as the command. Running the same build.py command by hand works (3 translated, 3 pass spirv-val).

The sibling rules pass LEONIDA_SPIRV_TOOLS=${LEONIDA_SPIRV_TOOLS_NATIVE}, which build.py (line 176) prepends to PATH itself. This rule now does the same. One line changed.

Tested

Windows 11, VS 2026 (generator "Visual Studio 18 2026"), Vulkan SDK 1.4.363.1, llvm-mc 21 (WSL), on main 16282101:

  • Before: the full build fails at the M2 formats shader rule (MSB8066).
  • After: the full build succeeds; d3d12_m2_formats_test passes 12/12 (0 of 4096 pixels differ in every case) with LEONIDA_VK_VALIDATION=1 on an RX 9070 XT (RDNA4, 32.0.31041.1004) and a Ryzen 7 9800X3D iGPU (RDNA2, 32.0.21045.5002).

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (N/A: build fix only.)

AI-assisted (Claude Code).

…_TOOLS, not PATH

The rule added with the M2 formats test (ItsNotRexed#1996) ran build.py through
cmake -E env "PATH=${LEONIDA_SPIRV_TOOLS_NATIVE};$ENV{PATH}". The ;s in
that string make it a CMake list, so on Windows cmake -E env received
each PATH entry as its own argument and tried to run one as the command:
"no such file or directory" (MSB8066) at "Translating vs_m2, ps_m2 and
ps_m2_array", which stopped every Windows build that has llvm-mc. The
sibling rules pass LEONIDA_SPIRV_TOOLS, which build.py prepends to PATH;
this one does the same now.

AI-assisted (Claude Code).
@Vonsek

Vonsek commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Second check of c2ec6165 on Windows. I configured the exact M2 formats CMake rule in a minimal Visual Studio 2022 project with a stub shader builder, a tools directory containing spaces, and a PATH entry ending in a backslash. The parent rule exited with MSB8066 before the stub ran. The new rule exited 0. The stub received the configured LEONIDA_SPIRV_TOOLS directory, the LLVM_MC setting, and all three shader arguments in order.

I also ran the real build.py with SPIRV-Tools supplied only through LEONIDA_SPIRV_TOOLS. It translated vs_m2, ps_m2, and ps_m2_array, and all three modules passed Vulkan 1.2 validation. No native runtime build, GPU, or game data was used.

AI-assisted.

@AC-Storm-YT

Copy link
Copy Markdown
Contributor Author

@Vonsek thanks, good to have the spaces and trailing-backslash cases covered too.

@JRamos1993

Copy link
Copy Markdown
Contributor

Tested c2ec616 on an RTX 5090 (driver 616.92), Windows 11, MSVC 19.44, Vulkan SDK 1.4.363, RelWithDebInfo:

  • Full ctest: 130/130.
  • Warnings: none new in the files this PR changes.

AI-assisted (Claude Code).

@ItsNotRexed
ItsNotRexed merged commit de5eda2 into ItsNotRexed:main Nov 22, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants