双臂新张,四境通衢 · Add Linux and Windows arm64 CPU native packages#22
Merged
Conversation
Expand the prebuilt npm platform set from four to six builds by adding Linux arm64 (glibc) and Windows arm64 CPU-only native packages. - cmake/Dependencies.cmake: select runtimes/linux-arm64 and runtimes/win-arm64 from the pinned ONNX Runtime NuGet based on CMAKE_SYSTEM_PROCESSOR - load-native.cjs + npm_release.PLATFORMS + deps.lock.json: register the two new platform identities, packages, and dependency RIDs - npm-release.yml + core.yml: add ubuntu-24.04-arm and windows-11-arm runners with -A ARM64 for the Windows VS generator - npm_release.package_directories + test_npm_release: drop the hard-coded package count in favor of len(PLATFORMS) + 2 - version bump 0.3.0 -> 0.3.1 per the conservative patch policy WebGPU stays x64-only: the official plugin EP 0.1.0 ships no linux-arm64 binary, and windows-arm64 WebGPU has not passed the real-device Provider Gate required for a production-qualified release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
有用户提出需要 arm64 的 Linux 和 Windows 版本。本 PR 把预编译 npm 平台集合从四个扩展到六个,新增 Linux arm64 (glibc) 与 Windows arm64 两个 CPU-only native 包,版本
0.3.0 → 0.3.1。经核实,两个平台的 CPU 路径在官方依赖层面完全成立:pinned ONNX Runtime 1.22.0 NuGet 同时提供
runtimes/linux-arm64与runtimes/win-arm64;OpenCV/clipper/stb/json 均为platforms:[all]源码,在 ARM runner 上原生可编;模型 bundle 平台无关。Changes
核心构建
cmake/Dependencies.cmake— Windows 分支按CMAKE_SYSTEM_PROCESSOR选win-arm64/win-x64;Linux 扩展aarch64→linux-arm64/native(原为FATAL_ERROR)bindings/node/CMakeLists.txt— Node addon 的编译期平台身份(LIGHT_OCR_NODE_PLATFORM_ID等)同样按处理器区分 arm64,确保 load-time contract 比较与 descriptor 一致平台契约
bindings/node/js/load-native.cjs— 平台识别 + 包名映射加linux-arm64、win32-arm64tools/npm_release.py— PLATFORMS 加两平台;package_directories从硬编码 6 改为len(PLATFORMS) + 2models/deps.lock.json—onnxruntime-cpuplatforms 声明加linux-arm64-gnu、windows-arm64CI
npm-release.yml— build-native + test-packages 矩阵加ubuntu-24.04-arm、windows-11-arm;Windows CMake 用-A ARM64;step name 改计数中性措辞core.yml— tier1 矩阵加两个 ARM runner版本与测试
CMakeLists.txt/bindings/node/package.json—0.3.0 → 0.3.1tests/python/test_npm_release.py— 数量断言改动态(len(PLATFORMS)),版本字符串改动态读取tests/python/npm_release_fixtures.py—current_platform_id()加 ARM 映射文档 — CHANGELOG、README(中英)、bindings/node/README、docs/npm-packaging、docs/build-and-release、docs/napi-design 全部同步至六平台/八包
WebGPU
两个 ARM 平台均为 CPU-only。WebGPU 保持 x64-only,原因:
runtimes/下仅有linux-x64)npm_release.py的qualificationOnly门禁)两个 ARM CPU 包与 macOS 两条线完全对等。
Verification
assemble成功 stage 全部 6 个 native 平台 + facade(版本 0.3.1)onnxruntime-cpu+ 4 个 common 依赖test_npm_release/test_npm_webgpu_release:8/9 通过(唯一失败的npm pack是本地内嵌 npm 工具链损坏npm-prefix.js MODULE_NOT_FOUND,与代码无关,CI 标准环境不受影响)gpt-5.6-sol代码评审:首轮发现 addon 平台身份 blocking bug(已修),次轮确认无 blocking、无新问题、四项修复全部 VERIFIEDubuntu-24.04-arm/windows-11-armrunner 执行Review history
gpt-5.6-solreview:REQUEST CHANGES — 发现bindings/node/CMakeLists.txt把 addon 平台身份硬编码为 x64,ARM 包加载必失败🤖 Generated with assistance from DimCode