pluginhandler: patch and handle elf files on glibc mismatch
Metadata
Current evaluation
Merged. Resolves glibc mismatches in ELF files by fetching libc6 from the host, priming it, and using its dynamic loader instead of the base snap's. Approved by two reviewers and closes issues #1668 and #1669.
Suggested action: —
No scores available.
Issue body
If the required glibc is greater than the one provided by the given
base, fetch libc6 from the host, prime it and use the dynamic loader
from there instead.
Closes: #1668 #1669
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)?
- [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Resolves glibc mismatches in ELF files by fetching libc6 from the host, priming it, and using its dynamic loader instead of the base snap's. Approved by two reviewers and closes issues #1668 and #1669. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix that patches ELF files on glibc mismatches by fetching and priming libc6 from the host to use its dynamic loader. Resolves issues #1668 and #1669. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged a fix that patches ELF files on glibc mismatches by fetching and priming libc6 from the host, then routing execution through its dynamic loader. Closes #1668 and #1669. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2012 pluginhandler: only do elf checking and patching for type app | snapcraft | merged | Merged changes restricting ELF checking and patching to app-type snaps, removing unnecessary libc6 ABI/API checks for other types. Resolves LP: #1757094. Approved and passed CI. | |
| #3277 pluginhandler: support using patchelf on strict snaps | snapcraft | merged | Adds enable-patchelf build attribute to opt into rpath and interpreter patching for strict snaps. Feature applies per-part. Review resolved naming and command-chain handling. Merged following a commit revert. | |
| #2021 pluginhandler: only resort to elf mangling if the snap type is app | snapcraft | merged | Merged a fix restricting ELF mangling to app-type snaps only. Approved, passed CI, and updated one file with 12 additions and 4 deletions. | |
| #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. | |
| #3841 elf: add elf file patcher | snapcraft | merged | Merged an ELF file patcher using patchelf, ported from Snapcraft 6.x. Approved by one reviewer, passed CI checks, and increased test coverage by 0.26%. Resolves CRAFT-1191. | |
| #1979 pluginhandler: simplify logic when elf patching is required | snapcraft | merged | Merged changes simplifying ELF patching logic in the pluginhandler. The update reduced code by 38 lines across six files, received reviewer approval, and passed checks before integration. | |
| #2005 pluginhandler: special case go patchelf failures for classic confinement | snapcraft | merged | Merged. Adds a warning for patchelf failures in classic confinement Go snaps and cleans up bases/libc6 logic. Approved after reviewer questions regarding patchelf crash output were addressed. | |
| #2081 elf: patch everything instead of a subset of elf files | snapcraft | merged | Merged a pull request that restores Snapcraft 2.39 behavior by patching all ELF files instead of a subset, reverting a prior change. Approved and passed CI. | |
| #3985 elf: patch elf files for classic mode | snapcraft | merged | Merged into main. Patches ELF binaries for classic mode to use the base snap interpreter and libraries, or bundled components if libc is staged, when enable-patchelf is enabled. Approved, passed CI, and merged. | |
| #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. |