← Back to issue list

many: set rpath for elf files for classic

View original Github issue

Metadata

Project
snapcraft
Number
#1781
Type
pull request
State
merged
Author
sergiusens
Labels
—
Created
Updated
Closed

Current evaluation

Merged as commit 3eafb9dd6, adding patchelf-based $ORIGIN-relative rpaths for ELF files in classic snaps and avoiding LD_LIBRARY_PATH side effects.

Resolution: closed resolved

Reason: PR #1781 was approved and merged, implementing the ELF rpath mechanism and explicitly fixing snapcraft#1663. Commit 3eafb9dd6 records the resolution.

Evaluated by: mr-cal-bot

No scores available.

Issue body

When working with classic confinement `LD_LIBRARY_PATH` cannot be set without consequences on when other assets on the host are called from the snap. This sets an rpath for every elf file when confinement is set to classic and allows for further extending this mechanism to non classic. When setting rpaths it also makes use of `$ORIGIN` to setup relative paths. Fixes: #1663 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 as commit 3eafb9dd6, adding patchelf-based $ORIGIN-relative rpaths for ELF files in classic snaps and avoiding LD_LIBRARY_PATH side effects.
stealth/space-bunny-alpha — closed resolved Merged PR #1781 (commit 3eafb9dd6) added patchelf-based, $ORIGIN-relative rpaths for ELF files in classic snaps, avoiding LD_LIBRARY_PATH side effects and fixing #1663.
qwen/qwen3.6-35b-a3b — — Merged. Configures rpath for ELF files in classic confinement using $ORIGIN and patchelf to eliminate LD_LIBRARY_PATH dependencies, resolving #1663. Approved after resolving CLA checks and transient CI failures.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Sets $ORIGIN rpath for ELF files in classic confinement to avoid LD_LIBRARY_PATH issues and fix #1663. Resolved CI and CLA checks, with maintainers confirming the patchelf approach correctly isolates library resolution.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft#1663 (confidence 100%)

    The merged PR body explicitly states that it fixes #1663.

Related issues

Issue Project State Summary Similarity
#1896 elf: do not strip rpaths that contain $ORIGIN snapcraft merged Merged PR #1896 preserved ELF rpaths containing $ORIGIN during stripping; commit c543156ff implemented the fix.
75%
#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.
75%
#3985 elf: patch elf files for classic mode snapcraft merged Merged PR #3985 as commit a723254b9, adding classic-mode ELF patching so enable-patchelf parts use base-snap libraries or staged libc components.
74%
#1988 elf: only set rpaths to libs of the same arch snapcraft merged Merged as commit 17f1f8c2f: elf dependency resolution now matches architecture (in addition to soname), so rpaths only point to libs of the same arch. Fixes LP #1752964 (i386 libc picked over amd64).
71%