Bundle libxml2 + ICU in the baremetal package so it runs on newer distros (fixes #4362)#4363
Open
exzile wants to merge 1 commit into
Open
Bundle libxml2 + ICU in the baremetal package so it runs on newer distros (fixes #4362)#4363exzile wants to merge 1 commit into
exzile wants to merge 1 commit into
Conversation
…tros The ovms binary links libxml2.so.2, but create_package.sh only bundles the bazel-out artifacts plus the OpenVINO/OpenCV/TBB/OpenCL libraries. libxml2 is pulled in from the base image (Dockerfile.ubuntu apt-installs it into the runtime image), so the portable tarball never included it. On Ubuntu 22.04/24.04 the host provides libxml2.so.2, which masks the gap; on a newer distro whose libxml2/ICU soname differs (Ubuntu 26.04 ships libxml2.so.16 + ICU 78) the tarball fails to start: ovms: error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such file or directory Bundle libxml2.so.2 and its ICU dependency chain (libxml2 -> libicuuc -> libicudata) from the build base, placed before the patchelf rpath pass so they resolve one another within the package. Verified: the ubuntu24 tarball now starts and serves models on the GPU on Ubuntu 26.04 (Intel Arc Pro B60). Fixes openvinotoolkit#4362 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: exzile <joeypongallo@gmail.com>
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.
Problem
The baremetal Linux release tarball fails to start on distros newer than the build base, because it does not bundle
libxml2— a runtime dependency of theovmsbinary.ldd /opt/ovms/bin/ovmsreportslibxml2.so.2 => not found.create_package.shbundles the bazel-out artifacts plus the OpenVINO/OpenCV/TBB/OpenCL libraries, butlibxml2is pulled in from the base image (Dockerfile.ubuntuapt-get install ... libxml2), so the portable tarball never included it. On Ubuntu 22.04/24.04 the host provideslibxml2.so.2, masking the gap. On a host whoselibxml2/ICU soname differs it breaks — e.g. Ubuntu 26.04 shipslibxml2.so.16+ ICU 78 (nolibxml2.so.2, no ICU 74):The full unmet chain (via
readelf -d) isovms → libxml2.so.2 → libicuuc.so.74 → libicudata.so.74.Reported in #4362.
Fix
Bundle
libxml2and its ICU dependency chain into/ovms_release/lib/increate_package.sh, alongside the existinglibOpenCLcopy and before thepatchelf --set-rpath '$ORIGIN/../lib'pass, so the copied libraries get an rpath that resolves them within the package.Only the minimal chain is bundled —
libz,liblzma,libstdc++,libm,libchave stable sonames present on every target and are intentionally left to the host.Verification
On Ubuntu 26.04 (glibc 2.43), with the current
v2026.2.1ovms_ubuntu24tarball the binary won't start (libxml2.so.2: cannot open shared object file). After adding these three libraries toovms/lib/,ldd ovmsis fully resolved and OVMS starts and serves an LLM on the GPU (Intel Arc Pro B60) end-to-end via/v3/chat/completions. This PR makescreate_package.shproduce that self-contained tarball directly.Notes / scope
redhatpackage (and aarch64) likely need the analogous copy from their own libdirs, but I could only verify ubuntu x86_64, so I left them untouched rather than ship unverified paths.libicudata(the ICU data bloblibxml2requires). If that's a concern, an alternative is to link a libxml2 built--without-icu(or statically), which would avoid bundling ICU — happy to pursue that direction instead if maintainers prefer.libxml2(MIT) and ICU (Unicode license) are now shipped in the tarball;thirdparty-licenses/may want their texts added.