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
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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