fix: detect missing system shared libraries on Linux#8
Merged
nicoloboschi merged 3 commits intomainfrom Apr 8, 2026
Merged
Conversation
On some Linux distros (e.g. Arch Linux), system shared libraries like libxml2 may be missing. The OS can't execute the postgres binary, causing initdb to report a misleading "postgres not found" error. After extraction, run ldd on the postgres binary (Linux only) and report any missing .so dependencies with actionable install guidance. If ldd is unavailable, the check is silently skipped. Adds a Docker integration test that removes libxml2 and verifies the new error message is surfaced correctly. Ref: vectorize-io/hindsight#919
- Add Rust build step in CI for the missing-libs test so it uses the PR binary (with shared lib detection) instead of the released one - Rewrite test script to use a mounted script file instead of nested heredocs to avoid bash quoting issues - Require PG0_BINARY_PATH to be set (test needs the PR binary)
The check_shared_libraries function uses &Path but it's gated with #[cfg(target_os = "linux")]. Use std::path::Path inline to avoid unused import warnings on non-Linux platforms.
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.
Summary
libxml2may be missing. The dynamic linker fails silently, causinginitdbto report a misleading "postgres not found" errorlddon thepostgresbinary (Linux only) and reports any missing.sodependencies with actionable install guidance for Arch, Ubuntu/Debian, and Fedora/RHELlddis unavailable, the check is silently skipped (no blocking)libxml2and verifies the clear error message is surfacedRef: vectorize-io/hindsight#919
Test plan
missing-libs-debian-amd64Docker test passes (removes libxml2, verifies error message)