Skip to content

[build] Be compatible with the latest protobuf - #23260

Merged
snnn merged 2 commits into
microsoft:mainfrom
snnn:snnn/pb1
Jan 6, 2025
Merged

[build] Be compatible with the latest protobuf#23260
snnn merged 2 commits into
microsoft:mainfrom
snnn:snnn/pb1

Conversation

@snnn

@snnn snnn commented Jan 6, 2025

Copy link
Copy Markdown
Contributor

Resolve #21308

@snnn
snnn requested a review from yuslepukhin January 6, 2025 17:23
@snnn snnn changed the title protobuf Be compatible with the latest protobuf Jan 6, 2025
@snnn snnn changed the title Be compatible with the latest protobuf [build] Be compatible with the latest protobuf Jan 6, 2025
@snnn
snnn requested a review from tianleiwu January 6, 2025 17:25
Comment thread onnxruntime/core/graph/graph.cc Outdated

@yuslepukhin yuslepukhin 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.

🕐

@yuslepukhin yuslepukhin 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.

:shipit:

@snnn
snnn merged commit 704523c into microsoft:main Jan 6, 2025
@snnn
snnn deleted the snnn/pb1 branch January 6, 2025 21:10
snnn pushed a commit that referenced this pull request Jan 8, 2025
tarekziade pushed a commit to tarekziade/onnxruntime that referenced this pull request Jan 10, 2025
guschmue pushed a commit that referenced this pull request Jan 12, 2025
ashrit-ms pushed a commit that referenced this pull request Mar 17, 2025
neko-para added a commit to MaaXYZ/MaaDeps that referenced this pull request Feb 16, 2026
MistEO added a commit to MaaAssistantArknights/MaaDeps that referenced this pull request May 31, 2026
## 问题

   CI 构建 `zlib:maa-arm64-windows` 时出现构建失败:

error: Missing msys2-mingw-w64-x86_64-pkgconf-1~2.2.0-1-any.pkg.tar.zst
error: https://mirror.msys2.org/.../pkgconf-1~2.2.0-1-any.pkg.tar.zst:
failed: status code 404

  根本原因:vcpkg 2024.10 在 `vcpkg_find_acquire_program(PKGCONFIG).cmake`
  中硬编码了 `pkgconf 1~2.2.0-1`。MSYS2 为滚动发布,只保留最新版本包,
  `1~2.2.0-1` 已从所有镜像删除。x64-windows 因 downloads 缓存命中而成功,
  arm64-windows 缓存为空故触发下载失败。

  此外,vcpkg 升级带来的 abseil、protobuf、GSL 版本变化导致
  macOS 和 Android 上的 `maa-onnxruntime` 构建失败。

  ## 变更内容

  本 PR 从下游仓库 [MaaXYZ/MaaDeps](https://github.com/MaaXYZ/MaaDeps)
  移植相关修复,对应 commit

[`f1f20fb`](MaaXYZ@f1f20fb)
  (feat: update vcpkg to 2025.12.12 #17)。

  ### `ddbfa29` — 升级 vcpkg 至 2025.12.12

  移植自下游 `f1f20fb`(部分):

  - 将 vcpkg 子模块从 `10b7a178`(2024-10)升至 `84bab45d`(2025-12),
    该版本包含 `c49e1c4e`,将 PKGCONFIG 脚本中的 pkgconf 更新为 `1~2.4.3-1`
- 将 `boost-asio` overlay 从 `1.86.0` 升至 `1.89.0`,以适配新版 vcpkg 的 boost
1.89.0 生态:
    - 以 `0001-add-options.patch` 替换 `opt-dep.diff`(适配 1.89.0 新版源码结构)
- 新增 `features.cmake`(`deadline-timer` / `spawn` 在 1.89.0 中改为可选 feature)

  ### `70bac09` — 为 maa-onnxruntime 补丁适配新版依赖

  移植自下游 `f1f20fb`(部分),从 onnxruntime 上游 PR 回移三个补丁:

  MaaFw 的 `f1f20fb` 的完整改动包括:
```
  1. vcpkg 子模块更新
  2. boost-asio overlay 更新(1.86.0 → 1.89.0)
  3. maa-onnxruntime 新增 3 个 patch
  4. opencv/opencv4 overlay 删除
  5. libffi overlay 新增
```
只移植第三项保证能过编译就行了,不然linux编译会炸

  | 补丁 | 来源 PR | 修复内容 |
  |------|---------|---------|
| `fix-pr-25815` | microsoft/onnxruntime#25815 | 移除
`absl::low_level_hash`(新版 abseil 已删除该符号) |
| `fix-pr-23260` | microsoft/onnxruntime#23260 | 用
`GOOGLE_PROTOBUF_VERSION < 5026000` 守卫 `ReleaseCleared()` |
| `fix-pr-23872` | microsoft/onnxruntime#23872 | 将 `gsl::byte` 替换为
`std::byte`(C++17 / 新版 GSL) |

## Summary by Sourcery

更新 vcpkg 和依赖覆盖层,以恢复可靠的跨平台构建并修复 Windows 上 pkgconf 下载失败的问题。

Bug 修复:
- 解决由于 msys2 中移除了 pkgconf 包而导致的 Windows arm64 vcpkg 构建间歇性失败问题。
- 修复由于 abseil、protobuf 和 GSL 版本升级而引起的 macOS 和 Android 上 maa-onnxruntime
构建失败问题。

增强:
- 更新 boost-asio 覆盖层,以与 vcpkg 较新的 Boost 生态对齐,并为 deadline timer 和 spawn
支持暴露可配置特性。

构建:
- 将 vcpkg 子模块升级到包含 Windows 上更新 pkg-config 处理方式的较新快照。
- 在 Windows vcpkg 安装中添加 `--clean-buildtrees-after-build` 以减少 CI 磁盘占用。
- 在 maa-onnxruntime 端口中应用来自上游 onnxruntime 的三个补丁,以保持与较新的 abseil、protobuf
和 GSL 版本的兼容性。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Update vcpkg and dependency overlays to restore reliable cross-platform
builds and fix Windows pkgconf download failures.

Bug Fixes:
- Resolve intermittent Windows arm64 vcpkg builds failing due to a
removed msys2 pkgconf package.
- Fix maa-onnxruntime build failures on macOS and Android caused by
updated abseil, protobuf, and GSL versions.

Enhancements:
- Update the boost-asio overlay to align with vcpkg's newer Boost
ecosystem and expose configurable features for deadline timer and spawn
support.

Build:
- Upgrade the vcpkg submodule to a newer snapshot that includes updated
pkg-config handling for Windows.
- Add --clean-buildtrees-after-build to Windows vcpkg installs to reduce
CI disk usage.
- Apply three upstream onnxruntime patches in the maa-onnxruntime port
to maintain compatibility with newer abseil, protobuf, and GSL releases.

</details>

## 由 Sourcery 提供的摘要

更新 vcpkg 和 overlay,以恢复跨平台构建并修复 Windows 上 pkgconf 解析问题。

Bug 修复:
- 解决由于缺少 msys2 pkgconf 包而导致的 Windows arm64 vcpkg 构建失败问题。
- 修复由于 abseil、protobuf 和 GSL 版本更新而在 macOS 和 Android 上出现的 maa-onnxruntime
构建失败问题。

增强功能:
- 通过 overlay 暴露可配置的 Boost.Asio 特性,以支持 deadline timer 和 spawn 功能。

构建:
- 将 vcpkg 子模块提升到更新的快照版本,以改进 Windows 上的 pkg-config 处理。
- 将 Boost.Asio overlay 更新到与当前 vcpkg Boost 生态系统兼容的更新版本。
- 在 maa-onnxruntime 端口中应用三个上游 onnxruntime 补丁,以保持与更新后的 abseil、protobuf 和
GSL 版本的兼容性。

<details>
<summary>Original summary in English</summary>

## Summary by Sourcery

Update vcpkg and overlays to restore cross-platform builds and fix
Windows pkgconf resolution issues.

Bug Fixes:
- Resolve Windows arm64 vcpkg build failures caused by a missing msys2
pkgconf package.
- Fix maa-onnxruntime build failures on macOS and Android due to updated
abseil, protobuf, and GSL versions.

Enhancements:
- Expose configurable Boost.Asio features for deadline timer and spawn
support via the overlay.

Build:
- Bump the vcpkg submodule to a newer snapshot with updated pkg-config
handling for Windows.
- Update the Boost.Asio overlay to a newer version compatible with the
current vcpkg Boost ecosystem.
- Apply three upstream onnxruntime patches in the maa-onnxruntime port
to keep compatibility with newer abseil, protobuf, and GSL releases.

</details>
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.

[Build] breakage with protobuf-27.2, due to API change

2 participants