Skip to content

Commit 768ae51

Browse files
Fix intermittent build failure on examples (#9059)
Fixes #9037 This commit removes CONFIGURE_DEPENDS from CMakeLists.txt for examples. This is to prevent intermittent build failures on Windows. Root cause: All examples share the same `examples/CMakeFiles/generate.stamp` file. When building in parallel, multiple targets trigger simultaneous CMake regenerations, causing a race condition on the shared stamp file (~10% failure rate). An alternative solution is to add CMakeFiles.txt for each and every examples. This will allow the build to run concurrently with their own `generate.stamp` file. But it may add unnecessary maintained cost when we need to add new examples. See: https://gitlab.kitware.com/cmake/cmake/-/issues/21571 --------- Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
1 parent d90d869 commit 768ae51

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

examples/CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ function(example dir)
33

44
set(debug_dir ${CMAKE_CURRENT_BINARY_DIR}/${dir})
55

6+
# CONFIGURE_DEPENDS is removed to prevent intermittent build failures on Windows.
7+
# See: https://github.com/shader-slang/slang/issues/9037
8+
#
9+
# Root cause: All examples share the same examples/CMakeFiles/generate.stamp file.
10+
# When building in parallel, multiple targets trigger simultaneous CMake regenerations,
11+
# causing a race condition on the shared stamp file (~10% failure rate).
12+
#
13+
# An alternative solution is to add CMakeFiles.txt for each and every examples.
14+
# This will allow the build to run concurrently with their own generate.stamp file.
15+
# But it may add unnecessary maintained cost when we need to add new examples.
16+
#
17+
# See: https://gitlab.kitware.com/cmake/cmake/-/issues/21571
618
file(
719
GLOB asset_files
8-
CONFIGURE_DEPENDS
20+
# CONFIGURE_DEPENDS
921
"${dir}/*.slang"
1022
"${dir}/*.jpg"
1123
"${dir}/*.obj"

0 commit comments

Comments
 (0)