fix(ci): restore ONNX Runtime downloads from pinned registries
Summary
Fixes #1343. The pinned ONNX Runtime 1.28.0 GitHub release assets now return 404, breaking native dependency setup before compilation. Keep the existing release URLs first and fall back to hash-pinned Microsoft packages:
- Stage Linux x64/arm64, Windows x64/arm64, and macOS arm64 binaries plus matching headers from NuGet in the existing
_deps/onnxruntime-srclayout used by desktop and Electron packagers. - Extract the iOS XCFramework from the same verified NuGet package when the Apple pod archive is unavailable.
- Source Android and static macOS missing headers from the verified Maven AAR; preserve the existing Sherpa and static ONNX libraries.
- Validate required libraries, headers, loader aliases, and cache identity before reusing staged packages. Document the fallback and its architecture coverage.
The NuGet package has no macOS x64 or Windows x86 native payload. Those architectures still require their GitHub release asset and fail with an explicit message if it is unavailable.
Verification
- Confirmed the original macOS release URL returns 404 and the CMake fallback configures and builds
rac_runtime_onnxrtfrom an empty build tree using_deps/onnxruntime-src. - Linked and ran a macOS executable against the staged dylib;
OrtGetApiBase()reported 1.28.0. - Downloaded the iOS fallback and linked/launched an arm64 iPhone simulator smoke app;
OrtGetApiBase()reported 1.28.0. - Built the static macOS Sherpa inventory and configured/built
rac_runtime_onnxrtusing it. - Verified normalized NuGet stages for Linux x64/arm64, Windows x64/arm64, and macOS arm64, including loader aliases and Windows import libraries. Verified cache repair after removing an alias.
python3 core/scripts/android/test_download_sherpa_onnx.py(13 passed),bash -n,shellcheck -e SC1091,git diff --check, and commit hooks passed.
Linux/Windows runtime builds and the full Android/Swift/Electron consumers still need the PR's native CI matrix. The repository-wide C++ lint script reports 77 existing formatting violations in unchanged C++ files; this PR changes no C++ source.
CI status
GitHub marked the PR's upstream workflows action_required before creating jobs. A maintainer needs to approve fork workflow execution; the PR build matrix and other native checks have not run on this commit. Keep this PR in draft until those required checks pass, then review the exact resulting commit and mark it ready.
Summary by CodeRabbit
-
Build & Dependency Updates
- ONNX Runtime downloads now verify package integrity and can use verified fallback packages when primary downloads are unavailable.
- Platform-specific setup now supports additional processor architectures, with unsupported configurations reporting errors.
- Android and iOS dependency downloads validate required files before updating cached files.
-
Documentation
- Development guidance now explains platform-specific ONNX Runtime downloads, fallback behavior, and related configuration options.