Skip to content

Commit 08e1d64

Browse files
snomiaoclaude
andcommitted
fix(release-rust): don't fail Windows packaging when no DLLs exist
capslockx-windows builds without the `stt` feature (whisper-rs doesn't compile on Windows), so sherpa-rs's build.rs is never invoked and no runtime DLLs are produced. clx.exe runs as a STT-stub in that case; the DLLs would only be needed if `stt` were enabled. Bundle DLLs when present, skip silently when not, instead of throwing "No DLLs found ... sherpa-rs build.rs may have failed". Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 0bafe85 commit 08e1d64

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

.github/workflows/release-rust.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,20 @@ jobs:
7676
# it to `clx.exe` so users get a clean PATH entry.
7777
Copy-Item rs\target\release\clx-rust.exe "$STAGE\clx.exe"
7878
Copy-Item rs\target\release\clx-screen-reader.exe "$STAGE\clx-screen-reader.exe"
79-
# Runtime DLLs (sherpa-onnx-c-api.dll, onnxruntime.dll, etc.) are
80-
# dropped by sherpa-rs's build.rs into target/release. Without these
81-
# clx.exe fails with STATUS_DLL_NOT_FOUND (0xC0000135) at launch.
79+
# Runtime DLLs (sherpa-onnx-c-api.dll, onnxruntime.dll, etc.)
80+
# are dropped by sherpa-rs's build.rs into target/release WHEN
81+
# the `stt` feature is enabled. capslockx-windows currently
82+
# builds without stt (whisper-rs doesn't compile on Windows),
83+
# so no DLLs are produced and clx.exe runs as a stt-stub
84+
# (Space+V no-op). Bundle whatever DLLs exist; don't fail if
85+
# there are none.
8286
$dlls = Get-ChildItem rs\target\release -Filter *.dll -ErrorAction SilentlyContinue
83-
if (-not $dlls) { throw "No DLLs found in rs\target\release — sherpa-rs build.rs may have failed" }
84-
foreach ($d in $dlls) { Copy-Item $d.FullName "$STAGE\" }
85-
Write-Host "Bundled DLLs: $($dlls.Name -join ', ')"
87+
if ($dlls) {
88+
foreach ($d in $dlls) { Copy-Item $d.FullName "$STAGE\" }
89+
Write-Host "Bundled DLLs: $($dlls.Name -join ', ')"
90+
} else {
91+
Write-Host "No runtime DLLs to bundle (stt feature off)"
92+
}
8693
Copy-Item scripts\install.ps1 "$STAGE\install.ps1"
8794
@"
8895
`$InstallDir = "`$env:LOCALAPPDATA\CapsLockX"
@@ -103,7 +110,7 @@ jobs:
103110
# relative to script dir)
104111
Copy-Item rs\target\release\clx-rust.exe scripts\clx.exe
105112
Copy-Item rs\target\release\clx-screen-reader.exe scripts\clx-screen-reader.exe
106-
Get-ChildItem rs\target\release -Filter *.dll | ForEach-Object {
113+
Get-ChildItem rs\target\release -Filter *.dll -ErrorAction SilentlyContinue | ForEach-Object {
107114
Copy-Item $_.FullName "scripts\"
108115
}
109116
# Install NSIS + EnVar plugin

0 commit comments

Comments
 (0)