elf: add fallback methods to detect library dependencies
Metadata
Current evaluation
Merged in snapcore/snapcraft#3514 (commit 76ca948c4): ELF dependency detection now falls back from ldd to host-libc6 preloading and loader tracing before warning.
Resolution: closed resolved
Reason: The PR was approved and merged into master as commit 76ca948c4 ("elf: add fallback methods to detect library dependencies (#3514)"), visible in the history of snapcraft/internal/elf.py. It adds three ldd fallbacks — plain ldd, ldd with LD_PRELOAD of host libc6, then LD_TRACE_LOADED_OBJECTS loader tracing — before emitting the original warning.
Evaluated by: mr-cal-bot
Issue body
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged in snapcore/snapcraft#3514 (commit 76ca948c4): ELF dependency detection now falls back from ldd to host-libc6 preloading and loader tracing before warning. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in snapcore/snapcraft#3514 (76ca948c4): ELF dependency detection now falls back from ldd to host-libc preloading and loader tracing before warning. | |
| qwen/qwen3.6-35b-a3b | — | — | 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master. Adds fallback methods to detect ELF library dependencies when ldd fails due to libc6 or LD_LIBRARY_PATH mismatches. Implements a three-step fallback chain before warning. Approved and merged with full coverage. |
Update history
No update history recorded yet.
Related work
-
Related To:
snapcore/snapcraft#2909
(confidence 40%)
Prior commit 'elf: search for host libraries within search paths' in the same file, addressing the same family of ldd/host-glibc dependency resolution problems.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3840 elf: add handling and patching helpers | snapcraft | merged | Merged in snapcore/snapcraft#3840 via commit 8a9914510, adding helpers to enumerate ELF binaries and locate architecture-specific dynamic linkers. | |
| #2746 elf: handle missing dependencies not found on system | snapcraft | merged | Merged PR #2746 via ed3f32aa3: ELF scanning now retains unresolved libraries, falls back to sonames, parses ldd output reliably, and tests missing-library cases. | |
| #4751 Use `ld` from the base snap for library linting | snapcraft | open | Triaged enhancement to make snapcraft lint resolve libraries with the target base snap's dynamic linker instead of host ldd, preventing spurious core24/core26 warnings; the TODO remains in current code. | |
| #2929 elf: fixes for corrupt shared objects | snapcraft | merged | Merged PR snapcore/snapcraft#2929 (commit 051f24e07, Feb 2020) catching elftools ConstructErrors as CorruptedElfFileError and skipping corrupt shared objects during library crawling. | |
| #1881 elf: better handling for newer libc6 | snapcraft | merged | Merged in snapcraft#1881 (commit 10ab28277), requiring libc6 to be explicitly declared in snapcraft.yaml so newer libc6 dependencies are recorded correctly. | |
| #75 refactor: rewrite elf file support | debcraft | merged | Merged as c841273, replacing Snapcraft-derived ELF handling with deb-oriented library dependency support. Symbol support was deferred to follow-up work. | |
| #1850 pluginhandler: patch and handle elf files on glibc mismatch | snapcraft | merged | Merged in snapcraft#1850 (bdaf0b7f1), adding host libc6 staging and its dynamic loader when ELF files need newer glibc; fixes #1668 and #1669. | |
| #1669 patchelf with ld-linux from the future | snapcraft | closed | Resolved by commit bdaf0b7f1, which added Snapcraft handling for PatchELF and ELF files when the built glibc/linker does not match the base. | |
| #1935 elf: contemplate more patching scenarios | snapcraft | merged | Merged PR #1935 as 048adc4a3, adding ELF patching for classic snaps built on bionic targeting core16 and for hooks built with Snapcraft. |