cmake: vk_null_descriptor_test's rule creates generated/ before glslangValidator writes into it (BUILD-NULL-DESCRIPTOR-GENERATED-DIR) #2096

Open
github-bot wants to merge 4 commits from github-bot/gh-2096 into main AGit
Owner

@⁠Tauwni on GitHub · 2026-11-25 20:16 UTC · original
Tauwni:fix/null-descriptor-generated-dir → main · +5 −0 · 1 files · 4 commits · draft

Claimed in the coordination issue as: #1608

What and why

Since ba626820e, a fresh macOS or Linux build of the runtime fails at vk_null_descriptor_test: its add_custom_command makes glslangValidator write ${CMAKE_CURRENT_BINARY_DIR}/generated/cs_null_descriptors.spv, but nothing has created generated/ when that rule runs, so it stops with "ERROR: Failed to open file" and the targets and ctest runs after it fail too. The rule now creates the directory first, with ${CMAKE_COMMAND} -E make_directory, as the other rule writing to generated/ does.

Tested

On an Apple M3 (macOS 26.5.1, CMake 4.5.1, Homebrew glslangValidator) from an empty build directory at main db1a22d29:

  • before: cmake --build ... --target vk_null_descriptor_test fails with "Failed to open file";
  • after: it builds, ctest -R vk_null_descriptor passes, and the whole build plus ctest give 96/96 passed.

GPUs tested: Apple M3 (MoltenVK 1.4.2), for vk_null_descriptor only

AI-assisted: yes (Claude Code)

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • No translator rule.

🤖 Generated with Claude Code

**@⁠Tauwni** on GitHub · 2026-11-25 20:16 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2096) `Tauwni:fix/null-descriptor-generated-dir` → `main` · +5 −0 · 1 files · 4 commits · draft Claimed in the coordination issue as: https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608 ### What and why Since `ba626820e`, a fresh macOS or Linux build of the runtime fails at `vk_null_descriptor_test`: its `add_custom_command` makes `glslangValidator` write `${CMAKE_CURRENT_BINARY_DIR}/generated/cs_null_descriptors.spv`, but nothing has created `generated/` when that rule runs, so it stops with "ERROR: Failed to open file" and the targets and ctest runs after it fail too. The rule now creates the directory first, with `${CMAKE_COMMAND} -E make_directory`, as the other rule writing to `generated/` does. ### Tested On an Apple M3 (macOS 26.5.1, CMake 4.5.1, Homebrew glslangValidator) from an empty build directory at `main` `db1a22d29`: - before: `cmake --build ... --target vk_null_descriptor_test` fails with "Failed to open file"; - after: it builds, `ctest -R vk_null_descriptor` passes, and the whole build plus `ctest` give 96/96 passed. GPUs tested: Apple M3 (MoltenVK 1.4.2), for `vk_null_descriptor` only AI-assisted: yes (Claude Code) ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [x] No translator rule. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a fresh macOS or Linux build tree nothing has made generated/ when this
rule runs, so glslangValidator stops with "Failed to open file" and the build
of vk_null_descriptor_test fails (and every test after it in ctest).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:17:42 +00:00
Author
Owner

@⁠Tauwni on GitHub · 2026-11-26 11:32 UTC · original

Merged main (a73a57e13) into this branch. It is still needed there: on an Apple M3 (macOS 26.5.1), a fresh cmake -S runtime -B build && cmake --build build of main stops at generated/cs_null_descriptors.spv (Error 1). ctest then gives 106/108, with root_signature and vk_null_descriptor Not Run. With this one line the build finishes, and those two pass: 108/108 (3 skipped: shader_library_corpus, vk_device_markers, vk_sync_validation).

AI-assisted (Claude Code).

**@⁠Tauwni** on GitHub · 2026-11-26 11:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2096#issuecomment-7190866115) Merged `main` (`a73a57e13`) into this branch. It is still needed there: on an Apple M3 (macOS 26.5.1), a fresh `cmake -S runtime -B build && cmake --build build` of `main` stops at `generated/cs_null_descriptors.spv` (`Error 1`). `ctest` then gives 106/108, with `root_signature` and `vk_null_descriptor` *Not Run*. With this one line the build finishes, and those two pass: 108/108 (3 skipped: `shader_library_corpus`, `vk_device_markers`, `vk_sync_validation`). AI-assisted (Claude Code).
From wavehs's finding in #1608: the per-rule make_directory covered only the
null-descriptor shader, and the other generated/*.spv rules relied on being
ordered after a rule that made the folder. A fresh -j8 build on macOS now
goes through without Failed to open file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠Tauwni on GitHub · 2026-11-27 08:59 UTC · original

Updated with main merged (c94bc3003), and widened after @⁠wavehs's finding in #1608: the other generated/*.spv rules also only worked because some earlier rule had made the folder. runtime/CMakeLists.txt now runs file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated) once at configure time, right after include(CTest), so no rule can run before the folder exists. The per-rule make_directory stays.

On an Apple M3 (macOS 26.5.1): a fresh cmake -S runtime -B <new dir> then cmake --build -j8 completes with no "Failed to open file", and ctest gives 114/115. The one failure, vk_bindless_dimensions, is a main failure on MoltenVK with its own fix. Without this change, a fresh build of just that test's target stops at generated/cs_bindless_dimensions.spv the same way, which shows the null-descriptor rule wasn't the only one affected.

AI-assisted (Claude Code).

**@⁠Tauwni** on GitHub · 2026-11-27 08:59 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2096#issuecomment-7214160514) Updated with `main` merged (`c94bc3003`), and widened after @⁠wavehs's finding in #1608: the other `generated/*.spv` rules also only worked because some earlier rule had made the folder. `runtime/CMakeLists.txt` now runs `file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated)` once at configure time, right after `include(CTest)`, so no rule can run before the folder exists. The per-rule `make_directory` stays. On an Apple M3 (macOS 26.5.1): a fresh `cmake -S runtime -B <new dir>` then `cmake --build -j8` completes with no "Failed to open file", and ctest gives 114/115. The one failure, `vk_bindless_dimensions`, is a `main` failure on MoltenVK with its own fix. Without this change, a fresh build of just that test's target stops at `generated/cs_bindless_dimensions.spv` the same way, which shows the null-descriptor rule wasn't the only one affected. AI-assisted (Claude Code).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2096/head:github-bot/gh-2096'
git switch 'github-bot/gh-2096'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2096'
git switch 'github-bot/gh-2096'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2096'
git switch 'github-bot/gh-2096'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2096'
git switch 'main'
git merge --squash 'github-bot/gh-2096'
git switch 'main'
git merge --ff-only 'github-bot/gh-2096'
git switch 'main'
git merge 'github-bot/gh-2096'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.