project_loader: improve the logic to install patchelf as a build tool
Metadata
Current evaluation
Merged changes improving patchelf installation logic by excluding it on xenial/armhf and xenial/s390x due to broken builds. Users must provide it manually or use the build-snap. Approved and merged after clarifying error handling and architecture exclusions.
Suggested action: —
No scores available.
Issue body
patchelf is a broken build on xenial/armhf and xenial/s390x so we do not add it as a build tool.
Users of the snapcraft deb will need to provide it in a part or use the build-snap.
Signed-off-by: Sergio Schvezov <sergio.schvezov@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] 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`?
-----
Integrating changes in #1943 one step at a time
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged changes improving patchelf installation logic by excluding it on xenial/armhf and xenial/s390x due to broken builds. Users must provide it manually or use the build-snap. Approved and merged after clarifying error handling and architecture exclusions. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged logic to exclude patchelf as a build tool on xenial/armhf and xenial/s390x due to broken builds. The change prevents unnecessary tracebacks and requires users to provide patchelf manually or use the build-snap. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #5486 build: add patchelf to make dependencies | snapcraft | merged | Merged to add patchelf to development environment dependencies, resolving test failures on self-hosted runners. Approved by two reviewers and passed CI checks. | |
| #1888 elf: make patchelf a dependency | snapcraft | merged | Merged after reviewer approval and CI checks. The change corrects patchelf handling by removing it from build_tools and properly configuring it as a dependency via debian/control for deb packages and snapcraft bundling for snaps. | |
| #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. | |
| #2528 packaging: use our patchelf branch | snapcraft | merged | Merged into master to fix s390x build failures by switching patchelf to a custom branch with a failing test disabled. The one-line change was approved, passed CI, and integrated. | |
| #2006 many: use packaging logic to get patchelf | snapcraft | merged | Merged following reviewer approval and CI checks. Refactored patchelf retrieval to use shared packaging logic, aligning its version across snap and deb packages. Modified four files with a net reduction of 24 lines. | |
| #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. | |
| #1873 elf: cleaner patchelf experience | snapcraft | merged | Merged improvements to patchelf handling. The change uses the system patchelf by default, copies files to prevent hard-link conflicts, and provides fallback instructions. Approved by two reviewers and passed CI checks before merging. | |
| #1798 elf: strip the .note.go.buildid to make room for patching elf | snapcraft | merged | Merged. Strips the .note.go.buildid section from ELF binaries to resolve patchelf compatibility issues and fix build failures. Approved after passing CI checks. Introduces a newer patchelf build-snap dependency to ensure correct header patching. | |
| #3588 snap: patch patchelf on riscv64 (CRAFT-566) | snapcraft | merged | Merged to master. Conditionally applies patchelf patches on riscv64 to prevent breaking other architectures. Approved by one reviewer, passed CI, and added 104 lines across three files without impacting test coverage. | |
| #1864 debian/control: Add patchelf to Depends: | snapcraft | closed | Closed without merging. Maintainers declined adding patchelf to Debian dependencies due to Xenial version constraints, noting it is supplied via build snaps or Docker images. Abandoned in favor of existing distribution methods. |