Skip to content

Add Go API for Windows arm64 - #3934

Merged
csukuangfj merged 1 commit into
k2-fsa:masterfrom
csukuangfj:go-win-arm64
Sep 8, 2026
Merged

csukuangfj merged 1 commit into
k2-fsa:masterfrom
csukuangfj:go-win-arm64

Conversation

@csukuangfj

@csukuangfj csukuangfj commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added Windows ARM64 support for the Go package.
    • Enabled building and testing on Windows ARM64 environments.
    • Added ARM64 Windows runtime library packaging for releases.
  • Documentation

    • Updated supported-platform documentation to include Windows ARM64.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 21580588-96f5-40f9-b7f4-69d693220879

📥 Commits

Reviewing files that changed from the base of the PR and between f2b550d and 8e52347.

📒 Files selected for processing (7)
  • .github/workflows/test-go-package.yaml
  • .github/workflows/test-go.yaml
  • scripts/go/_internal/build_windows_arm64.go
  • scripts/go/_internal/lib/aarch64-pc-windows-gnu/.gitkeep
  • scripts/go/generate.py
  • scripts/go/release.sh
  • scripts/go/sherpa_onnx.go

📝 Walkthrough

Walkthrough

Windows ARM64 support is added to the Go package, GitHub Actions build and test workflows, native library linking, and release packaging.

Changes

Windows ARM64 Go support

Layer / File(s) Summary
Platform constraints and native linking
scripts/go/_internal/build_windows_arm64.go, scripts/go/generate.py, scripts/go/sherpa_onnx.go
Go build constraints, cgo linker flags, generated files, and package documentation now include Windows ARM64.
CI build and test flow
.github/workflows/test-go.yaml, .github/workflows/test-go-package.yaml
The workflows add Windows ARM64 matrices, ARM64 MSVC setup, clang configuration, CMake ARM64 builds, ARM library handling, DLL copying, and tests.
Release packaging
scripts/go/release.sh
The release script downloads the Windows ARM64 wheel and copies its DLLs into aarch64-pc-windows-gnu.

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
Loading
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.go with ARM64 library search path.
  • Update the Go Windows release script to download/copy win_arm64 wheel 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.

Comment on lines +264 to +269
- name: Set up MSVC for ARM64
if: matrix.os == 'windows-11-arm' && matrix.arch == 'arm64'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: arm64

Comment on lines +67 to +72
- name: Set up MSVC for ARM64
if: matrix.os == 'windows-11-arm' && matrix.arch == 'arm64'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: arm64

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.

2 participants