Add Go API for Windows arm64 - #3934
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughWindows ARM64 support is added to the Go package, GitHub Actions build and test workflows, native library linking, and release packaging. ChangesWindows ARM64 Go support
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant workflow as GitHub Actions workflows
participant cmake as CMake
participant go_build as go build
participant arm_library as aarch64-pc-windows-gnu
workflow->>cmake: configure with -A ARM64
cmake->>arm_library: install ARM64 native libraries
workflow->>go_build: build with clang and clang++
go_build->>arm_library: use ARM64 DLLs
workflow->>go_build: run Windows ARM64 tests
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 golangci-lint (2.13.2)level=error msg="[linters_context] typechecking error: build constraints exclude all Go files in /scripts/go/_internal" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
The Windows ARM64 CI setup likely misconfigures the MSVC environment (arch: arm64 vs expected cross amd64_arm64), which can break ARM64 linking/building on the hosted runner.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds Windows ARM64 support to the Go bindings by introducing an ARM64-specific cgo link configuration, updating the release packaging script to ship ARM64 DLLs, and expanding CI to build/test on the windows-11-arm runner.
Changes:
- Add Windows arm64 support to Go build tags and introduce
build_windows_arm64.gowith ARM64 library search path. - Update the Go Windows release script to download/copy
win_arm64wheel DLLs into a new ARM64 lib directory. - Extend GitHub Actions Go workflows to build and run the Go tests on Windows ARM64.
File summaries
| File | Description |
|---|---|
| scripts/go/sherpa_onnx.go | Updates Go package doc comment to list Windows arm64 as supported. |
| scripts/go/release.sh | Packages Windows arm64 DLLs into the Go Windows release repo. |
| scripts/go/generate.py | Expands generated Go build constraints to include windows && arm64. |
| scripts/go/_internal/lib/aarch64-pc-windows-gnu/.gitkeep | Adds placeholder directory for Windows arm64 libraries. |
| scripts/go/_internal/build_windows_arm64.go | Adds cgo linker flags for Windows arm64 library directory. |
| .github/workflows/test-go.yaml | Builds and runs Go CI on windows-11-arm (arm64). |
| .github/workflows/test-go-package.yaml | Runs Go package tests on windows-11-arm (arm64). |
Review details
- Files reviewed: 6/7 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - name: Set up MSVC for ARM64 | ||
| if: matrix.os == 'windows-11-arm' && matrix.arch == 'arm64' | ||
| uses: ilammy/msvc-dev-cmd@v1 | ||
| with: | ||
| arch: arm64 | ||
|
|
| - name: Set up MSVC for ARM64 | ||
| if: matrix.os == 'windows-11-arm' && matrix.arch == 'arm64' | ||
| uses: ilammy/msvc-dev-cmd@v1 | ||
| with: | ||
| arch: arm64 | ||
|
|
Summary by CodeRabbit
New Features
Documentation