Fix Linux whisper.cpp archives missing libwhisper.so and versioned SONAMEs - #8
Merged
Merged
Conversation
The Linux staging step copied only `build/bin/libggml*.so`, which had three
consequences (SubtitleEdit issue #13680):
- libwhisper.so* was never matched by the glob, so whisper-cli's primary
dependency was absent from the archive entirely.
- `cp` dereferenced cmake's symlink chain, staging each library under its
unversioned alias (libggml.so) while its SONAME - and whisper-cli's
DT_NEEDED entry - said libggml.so.0. The loader looks up the SONAME, so
it never matched.
- The RUNPATH left in the binaries pointed at the CI build directory.
whisper-cli therefore died on startup with "error while loading shared
libraries: libwhisper.so.1" on every Linux install since whispercpp-184.
v1.8.3 and earlier shipped a statically linked binary, which is why this
went unnoticed when the build moved to BUILD_SHARED_LIBS=ON.
Stage each library as a real file named after its SONAME (a symlink chain
would not survive the trip: Subtitle Edit unpacks these with .NET's
ZipArchive, which writes symlink entries out as ordinary files containing
the target path), and rewrite every ELF's RPATH to $ORIGIN.
Add a verification step that copies the staged payload elsewhere and runs
the loader from an unrelated working directory with LD_LIBRARY_PATH
cleared, failing the build if any bundled whisper/ggml library does not
resolve. Libraries we intentionally do not ship - libvulkan from the GPU
driver, libcuda/libcudart/libcublas from the user's CUDA install - stay out
of scope.
Both Linux jobs now share the staging and verification scripts, so they
cannot drift apart again.
Co-Authored-By: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the Linux packaging bug behind SubtitleEdit#13680: whisper.cpp speech-to-text has been dead on every Linux install since
whispercpp-184withWhat was wrong
The Linux staging step was:
Three defects, all confirmed against the published
whisper-vulkan-linux64.zipandwhisper-cuda-linux64.zip:whisper-cliDT_NEEDEDlibwhisper.so.1libwhisper.so*libggml.so.0libggml.so(SONAME sayslibggml.so.0)libggml-base.so.0libggml-base.socpdereferences cmake's symlink chain (libggml.so -> libggml.so.0 -> libggml.so.0.9.4), so each library landed under its unversioned alias while the loader looks it up by SONAME. On top of that the binaries carryRUNPATH=/home/runner/work/support-files/support-files/build/bin, which does not exist on a user's machine.v1.8.3 and earlier shipped a statically linked
whisper-cli, which is why nothing broke until the build moved toBUILD_SHARED_LIBS=ONfor theGGML_CPU_ALL_VARIANTSplugin set.What changed
ZipArchive, whose zip path writes a symlink entry out as an ordinary file containing the target path.patchelf --set-rpath '$ORIGIN'. The libraries need this as much as the executable does —DT_RUNPATHis not inherited by transitive dependencies, sowhisper-cli's RPATH does not helplibggml.so.0findlibggml-base.so.0.LD_LIBRARY_PATHcleared, and fails the build if any bundled whisper/ggml library does not resolve. Libraries we intentionally do not ship —libvulkanfrom the GPU driver,libcuda/libcudart/libcublasfrom the user's CUDA install — stay out of scope. This is the guard that was missing: the build machine had the libraries inbuild/binthe whole time, so nothing ever noticed.Follow-up in the main repo
Publishes to a new tag
whispercpp-191-r2; the two Linux URLs and theLinuxVulkan/LinuxCudahash lists inWhisperDownloadService/DownloadHashManagerneed to point at it. Windows and macOS keep pointing atwhispercpp-191— both were unaffected (macOS ships a self-contained universal binary; Windows resolves DLLs from the exe directory).🤖 Generated with Claude Code