From 080e3d0adb7662816c1722021033496392f3f3c5 Mon Sep 17 00:00:00 2001 From: will wade Date: Sun, 16 Aug 2026 16:17:15 +0000 Subject: [PATCH] fix(publish): exact-pin sherpa-onnx 1.13.5 + matching win-x86 prebuilt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The i686-windows release build failed with LNK2019: unresolved _SherpaOnnxGetOnnxruntimeVersionStr. Cargo.lock is gitignored and the version job rewrites Cargo.toml, so every release build resolves dependencies fresh — sherpa-onnx drifted to 1.13.5 while the i686 workaround still downloaded the v1.13.4 win-x86 static lib, whose C-API lacks that symbol (verified: 3 occurrences in the 1.13.5 archive's sherpa-onnx-c-api.lib, 0 in 1.13.4's). Also, an exact 1.13.4 pin is not viable: sherpa-onnx 1.13.4 does not compile against sherpa-onnx-sys 1.13.5 (upstream doesn't pin its own sys dep; OfflineSpeechDenoiserDpdfNetModelConfig gained a field), so the only consistent fresh resolution is a matched pair. - Cargo.toml: sherpa-onnx = "=1.13.5" with a KEEP-IN-SYNC note - publish.yml: download v1.13.5 win-x86 static libs; comments explain both failure modes of drift (compile error, LNK2019) Verified locally: fresh lock resolves 1.13.5/1.13.5, release build ok, 178 lib tests green, live sherpa suite green except the two tests whose matcha model isn't downloaded locally (CI fetches it). --- .github/workflows/publish.yml | 15 +++++++++++---- Cargo.toml | 7 ++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f6274a1..1c628d6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -141,13 +141,20 @@ jobs: if: matrix.target == 'x86_64-unknown-linux-gnu' run: sudo apt-get update && sudo apt-get install -y libspeechd-dev libclang-dev - name: Download sherpa-onnx x86 prebuilt (32-bit Windows only) - # sherpa-onnx-sys doesn't auto-detect win-x86 yet, but the prebuilt - # static libs exist at v1.13.4. Download them and point the build at - # the extracted directory via SHERPA_ONNX_LIB_DIR. + # sherpa-onnx-sys doesn't auto-detect win-x86, so download the + # prebuilt static libs for the pinned crate version and point the + # build at them via SHERPA_ONNX_LIB_DIR. + # + # KEEP IN SYNC with the exact `sherpa-onnx` pin in Cargo.toml: + # builds resolve fresh (Cargo.lock is gitignored and the version + # job rewrites Cargo.toml), so a version mismatch means either a + # compile error (crate/sys pair drift) or LNK2019 (crate newer + # than the lib, e.g. 1.13.5's SherpaOnnxGetOnnxruntimeVersionStr + # missing from the 1.13.4 lib). if: matrix.target == 'i686-pc-windows-msvc' shell: pwsh run: | - $url = "https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.13.4/sherpa-onnx-v1.13.4-win-x86-static-MD-Release-lib.tar.bz2" + $url = "https://github.com/k2-fsa/sherpa-onnx/releases/download/v1.13.5/sherpa-onnx-v1.13.5-win-x86-static-MD-Release-lib.tar.bz2" Invoke-WebRequest -Uri $url -OutFile sherpa-x86.tar.bz2 mkdir sherpa-x86-libs | Out-Null tar -xjf sherpa-x86.tar.bz2 -C sherpa-x86-libs --strip-components=1 diff --git a/Cargo.toml b/Cargo.toml index 53c582b..b2cc426 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,12 @@ display_names = ["dep:icu_displaynames", "dep:icu_locid"] reqwest = { version = "0.12", features = ["blocking", "json", "rustls-tls"], default-features = false, optional = true } serde = { version = "1", features = ["derive"] } serde_json = { version = "1", optional = true } -sherpa-onnx = { version = "1.13", optional = true } +# Exact pin: the i686-windows publish job links a prebuilt static lib +# downloaded from the k2-fsa release of THIS version (see publish.yml +# "Download sherpa-onnx x86 prebuilt"). A minor drift (crate 1.13.4 with +# sys 1.13.5 doesn't even compile, and a newer crate references C-API +# symbols an older prebuilt lib lacks → LNK2019). Bump both together. +sherpa-onnx = { version = "=1.13.5", optional = true } base64 = { version = "0.22", optional = true } speechmarkdown-rust = { version = "0.4.12", optional = true } anyhow = "1"