elf: do not strip rpaths that contain $ORIGIN
Metadata
Current evaluation
Merged PR #1896 preserved ELF rpaths containing $ORIGIN during stripping; commit c543156ff implemented the fix.
Resolution: closed resolved
Reason: PR #1896 was approved and merged as commit c543156ff. The change retains project-defined $ORIGIN paths so libraries Snapcraft would not otherwise discover remain available at runtime.
Evaluated by: mr-cal-bot
No scores available.
Issue body
This is enabled to support users setting up rpaths for their
projects for paths that snapcraft would not find otherwise.
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`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #1896 preserved ELF rpaths containing $ORIGIN during stripping; commit c543156ff implemented the fix. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #1896 in commit c543156ff, preserving ELF rpaths containing $ORIGIN during stripping so project-specific runtime library paths remain intact. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in #1896 via commit c543156ff, preserving ELF rpaths containing $ORIGIN during stripping so project-specific runtime library paths remain intact. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged to preserve ELF rpaths containing $ORIGIN during stripping. This allows custom runtime library paths that snapcraft would otherwise fail to resolve. Approved by reviewer and passed CI checks. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. The update modifies ELF processing to preserve rpaths containing $ORIGIN, preventing snapcraft from stripping them and enabling support for user-defined custom rpaths. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2019 elf: avoid duplicating rpath entries | snapcraft | merged | Merged PR #2019 as commit e7b9d745c, preventing repeated $ORIGIN-based RPATH entries so each needed path appears once. | |
| #1781 many: set rpath for elf files for classic | snapcraft | merged | Merged as commit 3eafb9dd6, adding patchelf-based $ORIGIN-relative rpaths for ELF files in classic snaps and avoiding LD_LIBRARY_PATH side effects. | |
| #1746329 Rpath patching overwrites existing rpaths | snapcraft (launchpad) | closed | Fixed by snapcore/snapcraft#1896 (commit c543156ff, 'elf: do not strip rpaths that contain $ORIGIN'): the patcher now prepends existing $ORIGIN rpaths to the snap's own rpath list instead of discarding them. | |
| #2085 elf: clear the current runpath before setting the rpath | snapcraft | merged | Merged PR #2085 in commit 4ed555c5e clears an ELF file's existing RUNPATH before setting RPATH, resolving #2071. |