From f29ca7bacae9507f83e8c56abdb604bd4efb4cf1 Mon Sep 17 00:00:00 2001 From: Tauwni <102470988+Tauwni@users.noreply.github.com> Date: Wed, 25 Nov 2026 19:59:16 +0100 Subject: [PATCH 1/2] cmake: vk_null_descriptor_test's rule creates generated/ before glslangValidator writes into it 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 --- runtime/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 66af48c7da..49cb714b44 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -2083,6 +2083,7 @@ if(TARGET Vulkan::Headers) if(Vulkan_GLSLANG_VALIDATOR_EXECUTABLE) set(_null_descriptors_spv ${CMAKE_CURRENT_BINARY_DIR}/generated/cs_null_descriptors.spv) add_custom_command(OUTPUT ${_null_descriptors_spv} + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/generated COMMAND ${Vulkan_GLSLANG_VALIDATOR_EXECUTABLE} -V --target-env vulkan1.3 -o ${_null_descriptors_spv} ${CMAKE_CURRENT_SOURCE_DIR}/test/glsl/cs_null_descriptors.comp DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/test/glsl/cs_null_descriptors.comp From c94bc30036e043959c27fbf3cf9bc05c140cfaf5 Mon Sep 17 00:00:00 2001 From: Tauwni <102470988+Tauwni@users.noreply.github.com> Date: Fri, 27 Nov 2026 09:55:54 +0100 Subject: [PATCH 2/2] cmake: make generated/ at configure time, so no rule that writes into it can run first 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 --- runtime/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index ec69be8336..cda2ad31ff 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -814,6 +814,10 @@ elseif(NOT WIN32) endif() include(CTest) +# Every rule that writes a generated/ file (the GLSL test shaders, d3d12_stubs.h, ...) expects the folder to +# exist, and only some of them make it: with -j a fresh build could run one of the others first ("Failed to open +# file"). Make it once here, before any rule runs. +file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated) # LEONIDA_TRANSLATOR_DEPS: what the rules that run test/shaders/build.py depend on besides their .asm files. include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/translator_deps.cmake") if(BUILD_TESTING)