Skip to content

Fix Dawn parallel build race condition in wasm_Release / build-wasm CI#29040

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-wasm-release-build
Draft

Fix Dawn parallel build race condition in wasm_Release / build-wasm CI#29040
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-wasm-release-build

Conversation

Copilot AI commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a patch for Dawn's emdawnwebgpu_headers_gen_add macro that inserts cmake -E make_directory before the cmake -E copy step, fixing a race condition where parallel build jobs (-j32) copy webgpu_glfw.h / webgpu_enum_class_bitmasks.h into a directory that hasn't been created yet.

Files changed:

  • cmake/patches/dawn/dawn_parallel_build_fix.patch — new patch targeting src/emdawnwebgpu/CMakeLists.txt in Dawn commit ec7b457:
    +        COMMAND ${CMAKE_COMMAND} -E make_directory "${EM_BUILD_GEN_DIR}/include/webgpu"
             COMMAND ${CMAKE_COMMAND} -E copy
  • cmake/external/onnxruntime_external_deps.cmake — registers the new patch in ONNXRUNTIME_Dawn_PATCH_COMMAND

Motivation and Context

The wasm_Release / build-wasm CI job was failing at "Build (simd + threads + WebGPU experimental)" with:

Error copying file "…/include/webgpu/webgpu_enum_class_bitmasks.h"
  to "…/gen/src/emdawnwebgpu/include/webgpu/webgpu_enum_class_bitmasks.h"

Dawn's copy custom commands in emdawnwebgpu_headers_gen_add have no CMake dependency on the DawnJSONGenerator that would normally create gen/src/emdawnwebgpu/include/webgpu/ first. With high parallelism the copy commands win the race and fail because the destination directory does not yet exist.

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
Copilot finished work on behalf of fdwr June 13, 2026 10:40
Copilot AI requested a review from fdwr June 13, 2026 10:40
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.

2 participants