packaging: use local patchelf
Metadata
Current evaluation
Merged as e39d2404c, adopting Patchelf 0.10 and relinking dynamic Go executables; later reverted by #2531 after architecture tests exposed unreliable binaries.
Resolution: closed resolved
Reason: PR #2519 was merged as commit e39d2404c, using Patchelf 0.10 and relinking built dynamic Go binaries with the system linker. Follow-up PR #2531 subsequently reverted to locally patched Patchelf 0.9 after architecture-test failures.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Pull patchelf from the latest stable tag from the upstream repository,
which contains patches critical for snapcraft to work properly with
Go ELF binaries.
Noteworthy patches and issues fixed:
- Avoid inflating file sizes needlessly and allow binaries to be stripped
- patchelf --set-interpreter fails with `cannot find section` (#66)
- --set-interpreter gives "cannot find section" for go binary (#138)
LP: #1805205
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
- [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] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged as e39d2404c, adopting Patchelf 0.10 and relinking dynamic Go executables; later reverted by #2531 after architecture tests exposed unreliable binaries. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged as e39d2404c, adding Patchelf 0.10 and relinking dynamic Go ELF binaries; #2531 later reverted it to locally patched 0.9 after architecture reliability failures. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged as e39d2404c: bundled local patchelf 0.10 plus system-linker relinking for Go/cgo ELF patching (LP #1805205). Later reverted by #2531 (44be372e3) back to locally patched 0.9 after arch-test flakiness. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #2519 as e39d2404c: added local patchelf 0.10 and system-linker relinking for Go ELF patching. #2531 later reverted to locally patched 0.9 after architecture reliability issues. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Relinked dynamic executables with the system linker to resolve set-rpath segfaults in Go binaries. Integrates upstream patchelf 0.10 to correctly set interpreters and fix ELF section layout issues. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Adopted local patchelf 0.10 to resolve Go ELF binary issues. Strategy shifted to relinking dynamic executables with the system linker, fixing rpath segfaults. Approved and merged following coverage validation and reviewer feedback. |
Update history
No update history recorded yet.
Related work
-
Superseded By:
snapcraft#2531
(confidence 99%)
Merged as 44be372e3 to restore locally patched Patchelf 0.9 after #2519 produced unreliable binaries.
-
Related To:
snapcraft#2528
(confidence 95%)
Follow-up packaging change used Snapcore's Patchelf branch and was later reverted by #2531.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2531 snap: revert to patchelf 0.9 with local patches | snapcraft | merged | Merged PR #2531 as commit 44be372e3, reverting from Patchelf 0.10 to locally patched 0.9 after architecture tests exposed unreliable binaries. | |
| #2006 many: use packaging logic to get patchelf | snapcraft | merged | Merged PR #2006 in commit aa2a40322, replacing separate patchelf retrieval with shared packaging logic so snap and deb builds use the same version. | |
| #6455 fix(patchelf): use the build-for architecture's dynamic linker | snapcraft | closed | PR #6455 was closed unmerged; its patchelf cross-compilation linker fix was not delivered, and #5836 remains open. | |
| #1798 elf: strip the .note.go.buildid to make room for patching elf | snapcraft | merged | Merged #1798 in fa8b7b174, stripping Go ELF .note.go.buildid sections before patching and requiring newer patchelf header-layout support. | |
| #1967 project_loader: improve the logic to install patchelf as a build tool | snapcraft | merged | Merged PR #1967 as commit 84aaac591, improving patchelf build-tool installation and excluding broken Xenial armhf/s390x packages. | |
| #2528 packaging: use our patchelf branch | snapcraft | merged | Merged (commit bd26cafd6, squashed merge of #2528): snapcraft.yaml now points patchelf sources at Snapcore's own patchelf branch with the failing s390x test disabled, unblocking s390x package builds; later reverted by #2531. | |
| #1983 snap: update revision of patchelf to use | snapcraft | closed | Closed unmerged; the bundled PatchELF revision bump in #1983 was superseded by #2006, which adopted packaging-based acquisition (commit aa2a40322). | |
| #2005 pluginhandler: special case go patchelf failures for classic confinement | snapcraft | merged | Merged PR #2005, making PatchELF failures for classic-confined Go snaps non-fatal warnings and cleaning up base/libc6 stage-package handling. |