microsoft / microsoft/onnxruntime

[Build] Windows x64 QNN CI Pipeline and all Windows binskim builds fail with MSB8040 (missing Spectre-mitigated libs) on Win2022-GPU-A10 pool

Open
#29,784 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build ep:QNN platform:windows stale
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

### Describe the issue

Every Windows build job that uses --use_binskim_compliant_compile_flags  (i.e. /Qspectre ) is failing at the CMake configure step. This blocks the build from completing successfully. It _seems_ like the self-hosted onnxruntime-github-Win2022-GPU-A10 1ES pool image is missing the "C++ Spectre-mitigated libs" MSVC component.  MSB8040 is raised by MSBuild when the toolset's Spectre-mitigated libraries are not installed on the machine.

### Urgency

This is causing failures in main, and in CI scenarios too.

https://github.com/microsoft/onnxruntime/actions/runs/29626388322

### Target platform

Windows

### Build script

python.exe "D:\a\_work\onnxruntime\onnxruntime\tools\ci_build\build.py" `
--config RelWithDebInfo --build_dir "...\build" --skip_submodule_sync --build_csharp `
--parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" `
--build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs `
--msbuild_extra_options "IncludeMobileTargets=false" --build_nuget `
--use_vcpkg --use_vcpkg_ms_internal_asset_cache

### Error / output

error MSB8040: Spectre-mitigated libraries are required for this project.
Install them from the Visual Studio installer (Individual components tab)
for any toolsets and architectures being used. [ ...\CMakeScratch\TryCompile-xxxxx\cmTC_xxxxx.vcxproj ]

preceded by ORT's own warning:

build [WARNING] - Could not locate the MSVC Spectre-mitigated CRT/STL libraries. ...
Install the 'C++ Spectre-mitigated libs' component from the Visual Studio installer ...

The failure is at  TryCompile  (compiler detection), so no ORT source is ever compiled. This blocks the build entirely and is independent of any PR's code.

### Visual Studio Version

• Visual Studio: 2022 Enterprise ( C:\Program Files\Microsoft Visual Studio\2022\Enterprise )
• MSVC toolset (v143): 14.44.35207
• Windows SDK: 10.0.26100.0

### GCC / Compiler Version

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tools/ci_build/build.py and the Win2022-GPU-A10 image configuration, then inspect the linked GitHub Actions run and the CMake TryCompile failure. Reproduce the provided build command and verify that the required C++ Spectre-mitigated libraries are available and that the affected Windows CI jobs complete without MSB8040.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, github-actions, python
Domain
build-system, ci-cd, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.