Skip to content

Update onnxruntime to 1.27.0 - #3718

Merged
csukuangfj merged 11 commits into
k2-fsa:masterfrom
csukuangfj:update-onnxruntime-1.27.0
Jul 3, 2026
Merged

csukuangfj merged 11 commits into
k2-fsa:masterfrom
csukuangfj:update-onnxruntime-1.27.0

Conversation

@csukuangfj

@csukuangfj csukuangfj commented Jul 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Updated bundled runtime components across mobile, desktop, and web builds to a newer release, improving platform support and consistency.
  • Bug Fixes

    • Fixed library loading and packaging paths for macOS and Windows builds.
    • Updated Java setup instructions to match the newer runtime version.
  • Chores

    • Adjusted CI test coverage and build workflows, including broader .NET SDK testing and some skipped model-based checks.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR bumps the pinned ONNX Runtime dependency from 1.24.3/1.24.4/1.26.0 to 1.27.0 across CMake fetch configs, Android/iOS build scripts, CI workflows, and Java API docs/loader code. It also disables several CI test steps, expands the .NET SDK matrix, adds a disabled tmate debug step, updates a Go API's zero-result handling, and updates Kotlin example model/source references.

Changes

ONNX Runtime 1.27.0 Dependency Upgrade

Layer / File(s) Summary
Linux ONNX Runtime CMake configs
cmake/onnxruntime-linux-aarch64*.cmake, cmake/onnxruntime-linux-arm*.cmake, cmake/onnxruntime-linux-x86_64*.cmake
Updates download URLs, mirror URLs, SHA256 hashes, and fallback file locations to reference ONNX Runtime 1.27.0 artifacts.
macOS ONNX Runtime CMake configs
cmake/onnxruntime-osx-arm64*.cmake, cmake/onnxruntime-osx-universal*.cmake, cmake/onnxruntime-osx-x86_64*.cmake
Updates download URLs, mirror URLs, SHA256 hashes, and fallback zip filenames to 1.27.0, including switching a .tgz reference to .zip.
Windows ONNX Runtime CMake configs
cmake/onnxruntime-win-arm64*.cmake, cmake/onnxruntime-win-x64*.cmake, cmake/onnxruntime-win-x86-static.cmake
Replaces per-CRT/build-type SHA256 hashes and updates archive filenames/URLs to reference 1.27.0.
WASM ONNX Runtime config
cmake/onnxruntime-wasm-simd.cmake
Updates URL/hash to 1.27.0 and simplifies FetchContent to a single URL, removing the mirror URL fallback.
Android/iOS build script defaults
build-android-*.sh, build-ios*.sh
Bumps default onnxruntime_version fallback values to 1.27.0.
CI packaging, Java loader, and docs
.github/workflows/jar.yaml, .github/workflows/test-go.yaml, sherpa-onnx/java-api/readme*.md, sherpa-onnx/java-api/.../LibraryUtils.java
Updates dylib copy/symlink targets and installation instructions to reference libonnxruntime.1.27.0.dylib/.so.1.27.0.

CI Test Suite Adjustments

Layer / File(s) Summary
Node.js test disabling
.github/scripts/test-nodejs-npm.sh, .github/scripts/test-nodejs-addon-npm.sh
Comments out the online punctuation test, funasr-nano offline test setup/execution, and SenseVoice microphone ASR/VAD addon test.
Windows diacritization test disabling
.github/workflows/windows-x64.yaml
Removes the diacritization script path trigger and comments out the "Test offline diacritization" workflow step.
Disabled tmate debug step
.github/workflows/test-nodejs.yaml
Adds a "Setup tmate session" step guarded by if: false.

.NET SDK Multi-Version Setup

Layer / File(s) Summary
Multi-version SDK installation
.github/workflows/test-dot-net.yaml, .github/workflows/test-dot-net-nuget.yaml
Configures actions/setup-dotnet to install both 8.0.x and 10.0.x instead of only 10.0.x.

Miscellaneous Fixes and Example Updates

Layer / File(s) Summary
Go zero-result handling
scripts/go/sherpa_onnx.go
GetResult() returns a populated result struct instead of nil when the result count is zero.
Kotlin example updates
kotlin-api-examples/run.sh
Switches Supertonic TTS test to a newer model version and adds QnnConfig.kt to two kotlinc-jvm source lists.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

  • k2-fsa/sherpa-onnx#3501: Same ONNX Runtime version-pinning points (jar.yaml dylib copy targets, LibraryUtils.java, CMake fetch configs) updated to a different target version.
  • k2-fsa/sherpa-onnx#3578: Updates the same cmake/onnxruntime-linux-x86_64-gpu.cmake URL/hash/fallback locations to matching v1.27.0 CUDA12 artifacts.
  • k2-fsa/sherpa-onnx#3605: Overlaps with the Supertonic-3 TTS model artifact switch in kotlin-api-examples/run.sh.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: bumping ONNX Runtime to version 1.27.0.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request upgrades the ONNX Runtime version from 1.24.x/1.26.0 to 1.27.0 across various platform build scripts, CMake configurations, and Java API utilities, updating the respective download URLs and hashes. Additionally, it disables certain failing Node.js tests, updates Kotlin API examples to use a newer Supertonic TTS model, and modifies the Go API to return a populated result structure instead of nil when the token count is zero. Feedback on these changes suggests checking for non-nil C string pointers in the Go API to prevent crashes, and restoring the removed mirror URL configuration in the WebAssembly CMake file to ensure consistent offline and mirror build support.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread scripts/go/sherpa_onnx.go
Comment on lines 942 to +948
result := &OfflineRecognizerResult{}
result.Text = C.GoString(p.text)
result.Lang = C.GoString(p.lang)
result.Emotion = C.GoString(p.emotion)
result.Event = C.GoString(p.event)
if n == 0 {
return result

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

To prevent potential crashes, always check if the C string pointers are non-nil before converting them to Go strings.

	result := &OfflineRecognizerResult{}
	if p.text != nil {
		result.Text = C.GoString(p.text)
	}
	if p.lang != nil {
		result.Lang = C.GoString(p.lang)
	}
	if p.emotion != nil {
		result.Emotion = C.GoString(p.emotion)
	}
	if p.event != nil {
		result.Event = C.GoString(p.event)
	}
	if n == 0 {
		return result
	}

Comment on lines +13 to +14
set(onnxruntime_URL "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.27.0/onnxruntime-wasm-static_lib-simd-1.27.0.zip")
set(onnxruntime_HASH "SHA256=076680969c74225caf0a6d08c0be5edd2c242b081c33cede77dcc5eac355bbcf")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The mirror URL onnxruntime_URL2 (pointing to Hugging Face mirror) was removed in this file, but kept in all other platform CMake files. Removing it breaks offline/mirror builds for WebAssembly (WASM) platforms in environments with restricted internet access. Please restore onnxruntime_URL2 to maintain consistency and reliability.

set(onnxruntime_URL  "https://github.com/csukuangfj/onnxruntime-libs/releases/download/v1.27.0/onnxruntime-wasm-static_lib-simd-1.27.0.zip")
set(onnxruntime_URL2 "https://hf-mirror.com/csukuangfj2/onnxruntime-libs/resolve/main/1.27.0/onnxruntime-wasm-static_lib-simd-1.27.0.zip")
set(onnxruntime_HASH "SHA256=076680969c74225caf0a6d08c0be5edd2c242b081c33cede77dcc5eac355bbcf")

Comment on lines 28 to 33
if(EXISTS ${f})
set(onnxruntime_URL "${f}")
file(TO_CMAKE_PATH "${onnxruntime_URL}" onnxruntime_URL)
message(STATUS "Found local downloaded onnxruntime: ${onnxruntime_URL}")
set(onnxruntime_URL2)
break()
endif()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When a local file is found, onnxruntime_URL2 should be cleared to prevent FetchContent from attempting to download from the mirror. Please restore set(onnxruntime_URL2).

  if(EXISTS ${f})
    set(onnxruntime_URL  "${f}")
    file(TO_CMAKE_PATH "${onnxruntime_URL}" onnxruntime_URL)
    message(STATUS "Found local downloaded onnxruntime: ${onnxruntime_URL}")
    set(onnxruntime_URL2)
    break()
  endif()

Comment on lines 36 to 40
FetchContent_Declare(onnxruntime
URL
${onnxruntime_URL}
${onnxruntime_URL2}
URL_HASH ${onnxruntime_HASH}
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Please restore ${onnxruntime_URL2} in FetchContent_Declare to allow downloading from the mirror if the primary URL fails.

FetchContent_Declare(onnxruntime
  URL
    ${onnxruntime_URL}
    ${onnxruntime_URL2}
  URL_HASH          ${onnxruntime_HASH}
)

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (4)
.github/scripts/test-nodejs-npm.sh (1)

62-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a comment explaining why the funasr-nano test is disabled.

Unlike the online-punctuation disable at Line 38 (# disable it now since it causes CI failure) or the Qwen3 block at Lines 12-13 (# disable it for now since it fails, possible due to not using a recent version of onnxruntime), this funasr-nano block gives no rationale. Without a reason or tracking reference, it's unclear if/when this should be re-enabled.

♻️ Suggested fix
+# TODO: disabled due to <reason>; re-enable once <condition>
 # curl -SL -O https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-funasr-nano-int8-2025-12-30.tar.bz2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/scripts/test-nodejs-npm.sh around lines 62 - 68, The funasr-nano
test block in test-nodejs-npm.sh is disabled without any explanation. Add a
short comment near the disabled commands and the test-offline-funasr-nano.js
invocation stating why it is turned off for now, following the style used in the
Qwen3 and online-punctuation sections, so the rationale and any future re-enable
condition are clear.
.github/workflows/test-nodejs.yaml (1)

119-123: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

if: false triggers actionlint constant-expression warning.

Static analysis flags Line 121: the step will never run because of the constant false condition, so actionlint recommends removing the if: section entirely rather than gating on a constant. Since the intent is clearly to keep this step available for quick re-enablement during debugging (see the commented # if: failure() alternative), consider commenting out the whole step instead of leaving a lint-triggering if: false, to keep CI lint output clean.

♻️ Suggested fix
-      - name: Setup tmate session
-        if: false
-        # if: failure()
-        uses: mxschmitt/action-tmate@v3
+      # - name: Setup tmate session
+      #   if: failure()
+      #   uses: mxschmitt/action-tmate@v3
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test-nodejs.yaml around lines 119 - 123, The “Setup tmate
session” step in the workflow is using a constant false condition, which
triggers actionlint’s constant-expression warning. Update the workflow so this
step is not guarded by `if: false`; either remove the `if` field entirely or
comment out the whole `Setup tmate session` block if it should remain easy to
re-enable later. Keep the change focused on the `mxschmitt/action-tmate@v3` step
and the nearby commented `if: failure()` hint.

Source: Linters/SAST tools

.github/scripts/test-nodejs-addon-npm.sh (1)

274-274: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a comment explaining why the SenseVoice microphone test is disabled.

No rationale is given for disabling test_vad_asr_non_streaming_sense_voice_microphone.js, making it unclear whether this is a temporary CI workaround or permanent removal.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/scripts/test-nodejs-addon-npm.sh at line 274, The SenseVoice
microphone test is disabled without any explanation, so add a brief inline
comment near the disabled `test_vad_asr_non_streaming_sense_voice_microphone.js`
invocation in `.github/scripts/test-nodejs-addon-npm.sh` explaining why it is
skipped and whether it is a temporary CI workaround or a permanent exclusion.
Keep the note close to the existing commented-out command so future readers can
understand the rationale when reviewing this test block.
.github/workflows/windows-x64.yaml (1)

336-343: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a comment explaining why the offline diacritization test is disabled.

The entire "Test offline diacritization" step is commented out with no rationale, and the corresponding path trigger was also removed (Line 14). Without context, it's unclear if this is temporary (e.g. blocked on the 1.27.0 upgrade) or should be tracked as a follow-up.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/windows-x64.yaml around lines 336 - 343, Add a brief
comment near the commented-out Test offline diacritization step in
windows-x64.yaml explaining why it is disabled and whether it is temporary or
pending follow-up. Reference the existing step name “Test offline
diacritization” and note the reason tied to the removed trigger/path change so
future readers understand whether this is blocked by the 1.27.0 upgrade or
another dependency. Keep the comment concise and specific enough to explain why
the workflow step remains disabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/scripts/test-nodejs-addon-npm.sh:
- Line 274: The SenseVoice microphone test is disabled without any explanation,
so add a brief inline comment near the disabled
`test_vad_asr_non_streaming_sense_voice_microphone.js` invocation in
`.github/scripts/test-nodejs-addon-npm.sh` explaining why it is skipped and
whether it is a temporary CI workaround or a permanent exclusion. Keep the note
close to the existing commented-out command so future readers can understand the
rationale when reviewing this test block.

In @.github/scripts/test-nodejs-npm.sh:
- Around line 62-68: The funasr-nano test block in test-nodejs-npm.sh is
disabled without any explanation. Add a short comment near the disabled commands
and the test-offline-funasr-nano.js invocation stating why it is turned off for
now, following the style used in the Qwen3 and online-punctuation sections, so
the rationale and any future re-enable condition are clear.

In @.github/workflows/test-nodejs.yaml:
- Around line 119-123: The “Setup tmate session” step in the workflow is using a
constant false condition, which triggers actionlint’s constant-expression
warning. Update the workflow so this step is not guarded by `if: false`; either
remove the `if` field entirely or comment out the whole `Setup tmate session`
block if it should remain easy to re-enable later. Keep the change focused on
the `mxschmitt/action-tmate@v3` step and the nearby commented `if: failure()`
hint.

In @.github/workflows/windows-x64.yaml:
- Around line 336-343: Add a brief comment near the commented-out Test offline
diacritization step in windows-x64.yaml explaining why it is disabled and
whether it is temporary or pending follow-up. Reference the existing step name
“Test offline diacritization” and note the reason tied to the removed
trigger/path change so future readers understand whether this is blocked by the
1.27.0 upgrade or another dependency. Keep the comment concise and specific
enough to explain why the workflow step remains disabled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16a92673-fdaf-4a23-9cba-c63d3ccca1d1

📥 Commits

Reviewing files that changed from the base of the PR and between ca66853 and 5503c40.

📒 Files selected for processing (40)
  • .github/scripts/test-nodejs-addon-npm.sh
  • .github/scripts/test-nodejs-npm.sh
  • .github/workflows/jar.yaml
  • .github/workflows/test-dot-net-nuget.yaml
  • .github/workflows/test-dot-net.yaml
  • .github/workflows/test-go.yaml
  • .github/workflows/test-nodejs.yaml
  • .github/workflows/windows-x64.yaml
  • build-android-arm64-v8a.sh
  • build-android-armv7-eabi.sh
  • build-android-x86-64.sh
  • build-android-x86.sh
  • build-ios-no-tts.sh
  • build-ios-shared.sh
  • build-ios.sh
  • cmake/onnxruntime-linux-aarch64-static.cmake
  • cmake/onnxruntime-linux-aarch64.cmake
  • cmake/onnxruntime-linux-arm-static.cmake
  • cmake/onnxruntime-linux-arm.cmake
  • cmake/onnxruntime-linux-x86_64-gpu.cmake
  • cmake/onnxruntime-linux-x86_64-static.cmake
  • cmake/onnxruntime-linux-x86_64.cmake
  • cmake/onnxruntime-osx-arm64-static.cmake
  • cmake/onnxruntime-osx-arm64.cmake
  • cmake/onnxruntime-osx-universal-static.cmake
  • cmake/onnxruntime-osx-universal.cmake
  • cmake/onnxruntime-osx-x86_64-static.cmake
  • cmake/onnxruntime-osx-x86_64.cmake
  • cmake/onnxruntime-wasm-simd.cmake
  • cmake/onnxruntime-win-arm64-static.cmake
  • cmake/onnxruntime-win-arm64.cmake
  • cmake/onnxruntime-win-x64-gpu.cmake
  • cmake/onnxruntime-win-x64-static.cmake
  • cmake/onnxruntime-win-x64.cmake
  • cmake/onnxruntime-win-x86-static.cmake
  • kotlin-api-examples/run.sh
  • scripts/go/sherpa_onnx.go
  • sherpa-onnx/java-api/readme.md
  • sherpa-onnx/java-api/readme.zh.md
  • sherpa-onnx/java-api/src/main/java/com/k2fsa/sherpa/onnx/LibraryUtils.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant