← Back to issue list

elf: handle missing dependencies not found on system

View original Github issue

Metadata

Project
snapcraft
Number
#2746
Type
pull request
State
merged
Author
cjp256
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #2746 via ed3f32aa3: ELF scanning now retains unresolved libraries, falls back to sonames, parses ldd output reliably, and tests missing-library cases.

Resolution: closed resolved

Reason: PR #2746 was approved and merged as commit ed3f32aa3. It preserves unresolved ELF dependencies, uses the soname when ldd reports a missing or invalid path, and adds missing-library test coverage.

Evaluated by: mr-cal-bot

No scores available.

Issue body

I believe that prior testing involved ldd picking up the host-installed binaries to properly catch which libs are missing. Handle the case where ldd may return "not found" or some other invalid resolution. In those cases, initialize soname_path to soname. - Update load_dependencies so that it does not filter out libraries that are not found. If done, the returned set isn't very useful for determining missing dependencies (unless they managed to get found on host, which is why it has worked thus far). - Refactor ldd into its own method and update it to parse ldd output more reliably. - Add unit test coverage for missing libraries in ldd output.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #2746 via ed3f32aa3: ELF scanning now retains unresolved libraries, falls back to sonames, parses ldd output reliably, and tests missing-library cases.
stealth/space-bunny-alpha — closed resolved Merged PR #2746 (commit ed3f32aa3) by cjp256: ELF load_dependencies no longer filters out libs missing on the system, falls back to soname paths, ldd parsing split into its own method, plus unit tests for "not found" ldd output.
stealth/space-bunny-alpha — closed resolved Merged #2746 (ed3f32aa3) to retain unresolved ELF dependencies, fall back to soname paths, parse ldd output reliably, and add missing-library tests.
stealth/space-bunny-alpha — closed resolved Merged ELF fix retains unresolved libraries from ldd, falls back to soname paths, and adds unit tests for missing dependencies.
qwen/qwen3.6-35b-a3b — — Merged updates to handle missing ELF dependencies when ldd fails to resolve them. The change prevents filtering unresolved libraries, refactors ldd parsing for reliability, and adds unit tests. Approved by one reviewer and passed CI checks.
qwen3.6-35b-a3b-mtp-q6 — — Merged fix for ELF dependency resolution when ldd reports missing libraries or invalid output. Refactored ldd parsing, updated load_dependencies to retain missing entries, and added unit tests.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2663 elf: handle invalid elf files snapcraft merged PR #2663 merged as commit 89490853e: snapcraft/elf/elf_utils.py now catches elftools ELFError (and CorruptedElfFile) during dependency scanning and silently skips invalid ELF files, with a regression test for LP #1838098.
74%
#3514 elf: add fallback methods to detect library dependencies snapcraft merged Merged in snapcore/snapcraft#3514 (commit 76ca948c4): ELF dependency detection now falls back from ldd to host-libc6 preloading and loader tracing before warning.
74%
#2909 elf: search for host libraries within search paths snapcraft merged Merged PR #2909 (commit 12f05b3e4) by sergiusens fixes an ELF host-library regression from 76e8a3f3: host-found absolute library paths no longer bypass the configured library search paths; unit test added.
73%
#2932 elf: resolve paths in `ldd()` to purge relative path components snapcraft merged Merged #2932 in f30f91331: ldd() now resolves relative path components, skips empty entries such as linux-vdso, and updates the FakeElf fixture.
70%