← 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 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.

Suggested action:

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
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.
qwen3.6-35b-a3b-mtp-q6 Merged by cjp256, this change fixes ELF dependency resolution for missing system libraries. It prevents filtering unresolved dependencies, refactors ldd parsing for reliability, and adds unit test coverage.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2663 elf: handle invalid elf files snapcraft merged Merged changes to handle invalid ELF files by catching elftools exceptions and silently ignoring them. Includes a regression test, passed CI, and achieved 100% diff coverage. Resolves LP #1838098.
78%
#2932 elf: resolve paths in `ldd()` to purge relative path components snapcraft merged Merged. Resolves relative paths and empty strings in ldd() output. Updates FakeElf test fixture. Approved and merged after reviewer feedback on commit structure.
77%
#3514 elf: add fallback methods to detect library dependencies snapcraft merged Merged changes implementing fallback methods to detect library dependencies when ldd fails due to libc6 mismatches. The three-step detection logic was approved by reviewers and passed CI checks before integration.
74%
#2929 elf: fixes for corrupt shared objects snapcraft merged Merged to master. Resolves corrupt shared object handling by catching elftools ConstructErrors and skipping corrupted ELF files during library crawling. Approved, passed CI, and achieved 100% diff coverage.
74%
#3840 elf: add handling and patching helpers snapcraft merged Merged into main following reviewer approval and passing CI checks. Introduces ELF binary listing and dynamic linker location helpers, adding handling and patching utilities to the elf module while increasing test coverage.
74%
#1950 elf: better debug messages snapcraft merged Merged pull request polishing ELF debug messages for linker and library exclusion checks. Changes eliminate repetitive logging and reduce unnecessary calls. Approved by reviewers, passed CI, and successfully integrated.
74%
#75 refactor: rewrite elf file support debcraft merged Merged rewrite of ELF file support to better match deb building needs, replacing Snapcraft's implementation. Handles needed libraries; symbol support deferred. Approved by two reviewers, passed all CI checks, and resolves #72.
73%
#1881 elf: better handling for newer libc6 snapcraft merged Merged. Updates ELF handling for newer libc6 by requiring explicit libc6 declaration in snapcraft.yaml. Resolves dependency tracking, incorporates reviewer feedback, and passes CI. Segfaults on bionic are managed via adapter configuration.
73%
#1989 elf: don't parse elf more than necessary snapcraft merged Merged a single-line change optimizing ELF parsing to avoid unnecessary work, yielding a minor performance improvement. Approved by a maintainer and passed CI checks.
72%
#1899 elf: readelf dependency snapcraft closed Merged. The change ensures the readelf dependency is properly added and utilized based on the execution environment. Approved by one reviewer with passing checks.
72%