Fix Dawn parallel build race condition in wasm_Release / build-wasm CI#29040
Draft
Copilot wants to merge 2 commits into
Draft
Fix Dawn parallel build race condition in wasm_Release / build-wasm CI#29040Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Add cmake/patches/dawn/dawn_parallel_build_fix.patch which adds a cmake -E make_directory step before the cmake -E copy commands in Dawn's emdawnwebgpu_headers_gen_add macro. Without this, parallel builds (-j32) can trigger the copy commands for webgpu_glfw.h and webgpu_enum_class_bitmasks.h before DawnJSONGenerator creates the destination directory gen/src/emdawnwebgpu/include/webgpu/, causing the wasm_Release build to fail. Also register the new patch in the ONNXRUNTIME_Dawn_PATCH_COMMAND in cmake/external/onnxruntime_external_deps.cmake.
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job wasm_Release / build-wasm
Fix Dawn parallel build race condition in wasm_Release / build-wasm CI
Jun 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a patch for Dawn's
emdawnwebgpu_headers_gen_addmacro that insertscmake -E make_directorybefore thecmake -E copystep, fixing a race condition where parallel build jobs (-j32) copywebgpu_glfw.h/webgpu_enum_class_bitmasks.hinto a directory that hasn't been created yet.Files changed:
cmake/patches/dawn/dawn_parallel_build_fix.patch— new patch targetingsrc/emdawnwebgpu/CMakeLists.txtin Dawn commitec7b457:+ COMMAND ${CMAKE_COMMAND} -E make_directory "${EM_BUILD_GEN_DIR}/include/webgpu" COMMAND ${CMAKE_COMMAND} -E copycmake/external/onnxruntime_external_deps.cmake— registers the new patch inONNXRUNTIME_Dawn_PATCH_COMMANDMotivation and Context
The
wasm_Release / build-wasmCI job was failing at "Build (simd + threads + WebGPU experimental)" with:Dawn's copy custom commands in
emdawnwebgpu_headers_gen_addhave no CMake dependency on theDawnJSONGeneratorthat would normally creategen/src/emdawnwebgpu/include/webgpu/first. With high parallelism the copy commands win the race and fail because the destination directory does not yet exist.