Skip to content

Fix WebGPU build error when LTO is enabled - #32813

Merged
Scott McKay (skottmckay) merged 2 commits into
mainfrom
skottmckay/fix_webgpu_build_error
Sep 26, 2026
Merged

Scott McKay (skottmckay) merged 2 commits into
mainfrom
skottmckay/fix_webgpu_build_error

Conversation

@skottmckay

@skottmckay Scott McKay (skottmckay) commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Fix warning from recent change in #32729

LINK : error C2220: the following warning is treated as an error [N:_work\1\b\RelWithDebInfo\onnxruntime_provider_test.vcxproj]
LINK : warning C4744: 'static char const absl::lts_20250814::base_internal::FastTypeTag<class std::basic_string<char,struct std::char_traits,class std::allocator > >::kDummyVar' has different type in 'n:_work\1\b\relwithdebinfo_deps\googletest-src\googletest\src\gtest-all.cc' and 'n:_work\1\s\onnxruntime\test\providers\webgpu\webgpu_context_test.cc': 'unsigned char' and 'signed char' [N:_work\1\b\RelWithDebInfo\onnxruntime_provider_test.vcxproj]

Motivation and Context

Fix packaging pipeline

LINK : error C2220: the following warning is treated as an error [N:\_work\1\b\RelWithDebInfo\onnxruntime_provider_test.vcxproj]
LINK : warning C4744: 'static char const absl::lts_20250814::base_internal::FastTypeTag<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > >::kDummyVar' has different type in 'n:\_work\1\b\relwithdebinfo\_deps\googletest-src\googletest\src\gtest-all.cc' and 'n:\_work\1\s\onnxruntime\test\providers\webgpu\webgpu_context_test.cc': 'unsigned char' and 'signed char' [N:\_work\1\b\RelWithDebInfo\onnxruntime_provider_test.vcxproj]
@skottmckay

Copy link
Copy Markdown
Contributor Author

Yang Gu (@gyagp) could you please take a look?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused workaround addresses the reported LTO conflict and adds CI coverage for the affected configuration.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes WebGPU test linking under MSVC LTO by avoiding type-specific Abseil flag access.

Changes:

  • Uses Abseil’s type-erased flag reflection API with a non-Abseil fallback.
  • Enables LTO in Windows WebGPU CI coverage.
File Description
onnxruntime/​test/​providers/​webgpu/​webgpu_context_test.cc Safely sets and restores the death-test style flag.
.github/​workflows/​windows_webgpu.yml Adds LTO coverage to the main WebGPU build.

No actionable issues identified.


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@skottmckay
Scott McKay (skottmckay) merged commit d4bd813 into main Sep 26, 2026
96 checks passed
@skottmckay
Scott McKay (skottmckay) deleted the skottmckay/fix_webgpu_build_error branch September 26, 2026 04:23
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.

3 participants