Skip to content

[Build] Fix pybind11 vcpkg configuration#27514

Merged
tianleiwu merged 1 commit intomainfrom
tlwu/20260302/fix_pybind11_vcpkg
Mar 3, 2026
Merged

[Build] Fix pybind11 vcpkg configuration#27514
tianleiwu merged 1 commit intomainfrom
tlwu/20260302/fix_pybind11_vcpkg

Conversation

@tianleiwu
Copy link
Copy Markdown
Contributor

There is build error using --use_vcpkg without --use_vcpkg_ms_internal_asset_cache, the error is like:

C:\code\onnxruntime\cmake\./vcpkg-ports\pybind11: info: installing overlay port from here
Downloading https://github.com/pybind/pybind11/archive/v3.0.2.tar.gz -> pybind-pybind11-v3.0.2.tar.gz
pybind-pybind11-v3.0.2.tar.gz.33772.part: error: download from https://github.com/pybind/pybind11/archive/v3.0.2.tar.gz had an unexpected hash
note: Expected: 786b1bf534ac67a8d5669f8babf67bb13e48b3a3da1b6344e43ae10a84b80bbc8fea5f12a65fd18739c341fefef5622c5dc096db964dff33cc62ea4259b2e2c1
note: Actual  : 19bee2c76320e25202ee078b5680ff8a7acfb33494dec29dad984ab04de8bcb01340d9fec37c8cc5ac9015dfc367e60312dcd8506e66ce8f0af4c49db562ddef
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:136 (message):
  Download failed, halting portfile.

The root cause is that I uploaded zip file to cache server. Without --use_vcpkg_ms_internal_asset_cache, vcpkg will try download tar.gz file from github, and the SHA is different from the one of zip file.

In this PR, I configure the portfile to download zip file to avoid the issue.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a build error that occurs when using --use_vcpkg without --use_vcpkg_ms_internal_asset_cache. The internal asset cache stores .zip files, but vcpkg_from_github downloads .tar.gz by default, causing an SHA512 mismatch. The fix explicitly downloads the .zip archive via vcpkg_download_distfile, consistent with how cmake/deps.txt references pybind11.

Changes:

  • Replaced vcpkg_from_github with vcpkg_download_distfile + vcpkg_extract_source_archive to explicitly fetch the .zip archive instead of .tar.gz
  • Added an explanatory comment documenting why this approach is used and what the tar.gz hash would have been

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tianleiwu tianleiwu enabled auto-merge (squash) March 3, 2026 00:25
@tianleiwu tianleiwu merged commit f99dcca into main Mar 3, 2026
106 of 107 checks passed
@tianleiwu tianleiwu deleted the tlwu/20260302/fix_pybind11_vcpkg branch March 3, 2026 00:54
tianleiwu added a commit that referenced this pull request Mar 5, 2026
There is build error using `--use_vcpkg` without
`--use_vcpkg_ms_internal_asset_cache`, the error is like:
```
C:\code\onnxruntime\cmake\./vcpkg-ports\pybind11: info: installing overlay port from here
Downloading https://github.com/pybind/pybind11/archive/v3.0.2.tar.gz -> pybind-pybind11-v3.0.2.tar.gz
pybind-pybind11-v3.0.2.tar.gz.33772.part: error: download from https://github.com/pybind/pybind11/archive/v3.0.2.tar.gz had an unexpected hash
note: Expected: 786b1bf534ac67a8d5669f8babf67bb13e48b3a3da1b6344e43ae10a84b80bbc8fea5f12a65fd18739c341fefef5622c5dc096db964dff33cc62ea4259b2e2c1
note: Actual  : 19bee2c76320e25202ee078b5680ff8a7acfb33494dec29dad984ab04de8bcb01340d9fec37c8cc5ac9015dfc367e60312dcd8506e66ce8f0af4c49db562ddef
CMake Error at scripts/cmake/vcpkg_download_distfile.cmake:136 (message):
  Download failed, halting portfile.
```

The root cause is that I uploaded zip file to cache server. Without
`--use_vcpkg_ms_internal_asset_cache`, vcpkg will try download tar.gz
file from github, and the SHA is different from the one of zip file.

In this PR, I configure the portfile to download zip file to avoid the
issue.
tianleiwu added a commit that referenced this pull request Mar 5, 2026
This cherry-picks the following commits for the release:

| Commit ID | PR Number | Commit Title |
|-----------|-----------|-------------|
| d5387d8 | #27192 | Avoid repetitive creation of fp4/fp8
native-custom-op domains for NvTensorRtRtx EP |
| 0b9906a | #27454 | Suppress spurious Array Out of Bounds warnings
produced by GCC 14.2 compiler on Linux builds |
| 4a80b0b | #27471 | Fix double-free in TRT EP custom op domain
Release functions |
| c7c939f | #27499 | Fix -Warray-bounds build error in MLAS on clang
17+ |
| f99dcca | #27514 | [Build] Fix pybind11 vcpkg configuration |
| ef04b10 | #27518 | [CXX Lora] Prevent heap OOB from maliciously
crafted Lora Adapters. |
| 0b2b6d0 | #27288 | [NvTensorRTRTX EP]: Add missing override
specifiers to suppress warnings |
| c1d8f5c | #27522 | Add "library_path" metadata entry to OrtEpDevice
instances for plugin and provider bridge EPs |
| fdead1c | #27537 | Account for ORT_NO_EXCEPTIONS builds in Lora
test |
| 3d1365e | #27521 | increase kMaxValueLength to 8192 |
| df8f4a7 | #27535 | Add OrtEnv.DisableDllImportResolver to prevent
fatal error on resolver conflict |
| bdd672a | #27356 | Add/Update telemetry events |
| 2da1a30 | #27543 | Fix RoiAlign heap out-of-bounds read via
unchecked batch_indices |
| 5c3f544 | #27466 | DQ→MatMulNBits fusion transformer for
NvTensorRtRtx ep |

---------

Co-authored-by: vishalpandya1990 <vipandya@nvidia.com>
Co-authored-by: Vishnudas Thaniel S <vishnudas.thaniel.s@intel.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Dmitri Smirnov <yuslepukhin@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Stephan Seitz <sseitz@nvidia.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
Co-authored-by: xieofxie <xieofxie@126.com>
Co-authored-by: hualxie <hualxie@microsoft.com>
Co-authored-by: Darshak Bhatti <47045043+dabhattimsft@users.noreply.github.com>
Co-authored-by: Darshak Bhatti <dabhatti@micorsoft.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: anujj <ajalota@nvidia.com>
Co-authored-by: praneshgo <227579474+praneshgo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants