Update onnxruntime to 1.27.0 - #3718
Conversation
📝 WalkthroughWalkthroughThis 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. ChangesONNX Runtime 1.27.0 Dependency Upgrade
CI Test Suite Adjustments
.NET SDK Multi-Version Setup
Miscellaneous Fixes and Example Updates
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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
}| 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") |
There was a problem hiding this comment.
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")
| 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() |
There was a problem hiding this comment.
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()
| FetchContent_Declare(onnxruntime | ||
| URL | ||
| ${onnxruntime_URL} | ||
| ${onnxruntime_URL2} | ||
| URL_HASH ${onnxruntime_HASH} | ||
| ) |
There was a problem hiding this comment.
🧹 Nitpick comments (4)
.github/scripts/test-nodejs-npm.sh (1)
62-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd 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: falsetriggers actionlint constant-expression warning.Static analysis flags Line 121: the step will never run because of the constant
falsecondition, so actionlint recommends removing theif: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-triggeringif: 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 winAdd 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 winAdd 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
📒 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.yamlbuild-android-arm64-v8a.shbuild-android-armv7-eabi.shbuild-android-x86-64.shbuild-android-x86.shbuild-ios-no-tts.shbuild-ios-shared.shbuild-ios.shcmake/onnxruntime-linux-aarch64-static.cmakecmake/onnxruntime-linux-aarch64.cmakecmake/onnxruntime-linux-arm-static.cmakecmake/onnxruntime-linux-arm.cmakecmake/onnxruntime-linux-x86_64-gpu.cmakecmake/onnxruntime-linux-x86_64-static.cmakecmake/onnxruntime-linux-x86_64.cmakecmake/onnxruntime-osx-arm64-static.cmakecmake/onnxruntime-osx-arm64.cmakecmake/onnxruntime-osx-universal-static.cmakecmake/onnxruntime-osx-universal.cmakecmake/onnxruntime-osx-x86_64-static.cmakecmake/onnxruntime-osx-x86_64.cmakecmake/onnxruntime-wasm-simd.cmakecmake/onnxruntime-win-arm64-static.cmakecmake/onnxruntime-win-arm64.cmakecmake/onnxruntime-win-x64-gpu.cmakecmake/onnxruntime-win-x64-static.cmakecmake/onnxruntime-win-x64.cmakecmake/onnxruntime-win-x86-static.cmakekotlin-api-examples/run.shscripts/go/sherpa_onnx.gosherpa-onnx/java-api/readme.mdsherpa-onnx/java-api/readme.zh.mdsherpa-onnx/java-api/src/main/java/com/k2fsa/sherpa/onnx/LibraryUtils.java
Summary by CodeRabbit
New Features
Bug Fixes
Chores