← Back to issue list

project_loader: stop setting LD_LIBRARY_PATH

View original Github issue

Metadata

Project
snapcraft
Number
#2128
Type
pull request
State
closed
Author
kyrofa
Labels
—
Created
Updated
Closed

Current evaluation

Closed unmerged in #2128 as unnecessary after the last known Trusty classic-snap user moved to Xenial; no code was changed.

Resolution: closed stale

Reason: The maintainer closed PR #2128 after stating that the only known affected user had moved to Xenial. It was never merged, so no resolving commit or release fixed this PR.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [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`? ----- Currently, the snapcraft CLI sets `LD_LIBRARY_PATH` when building classic snaps so as to ensure libraries within the core snap are found. However, this wreaks havoc when building classic snaps on Trusty, since it forces all shelled-out commands to use the libc in the core snap, which causes segfaults. This PR fixes [LP: #1765482](https://bugs.launchpad.net/snapcraft/+bug/1765482) by no longer setting `LD_LIBRARY_PATH`, even for classic snaps. Since it's only set if the host system is determined to be compatible with the libc in the core snap, this _shouldn't_ have any ill effects, but this needs some heavy manual testing for classic snaps. This PR has been built into a snap released into the `edge/classic-trusty` channel.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed stale Closed unmerged in #2128 as unnecessary after the last known Trusty classic-snap user moved to Xenial; no code was changed.
stealth/space-bunny-alpha — closed stale Closed unmerged after the last known user of affected Trusty classic-snap builds moved to Xenial; no change was needed from the project_loader LD_LIBRARY_PATH workaround.
qwen/qwen3.6-35b-a3b — — Abandoned without merging. The LD_LIBRARY_PATH workaround was dropped after the sole user relying on the affected Trusty environment migrated to Xenial. The issue was resolved by the user's environment change.
qwen3.6-35b-a3b-mtp-q6 — — Abandoned after maintainer determined removing LD_LIBRARY_PATH was unnecessary once the last affected user migrated to Xenial. Initial testing and build VM alternatives were considered before closing.

Update history

No update history recorded yet.

Related work

  • Related To: snapcraft (launchpad)#1765482 (confidence 90%)

    The underlying Trusty classic-snap build report was addressed by abandoning the proposed LD_LIBRARY_PATH change.

  • Related To: snapcraft#1635 (confidence 72%)

    An earlier merged change removed LD_LIBRARY_PATH leakage from a classic wrapper and is relevant to the same library-path problem.

Related issues

Issue Project State Summary Similarity
#1635 snap: remove leaking LD_LIBRARY_PATH snapcraft merged Merged as da9181487: PR #1635 removed LD_LIBRARY_PATH leakage from snapcraft-classic, fixing LP #1723208 and preventing breakage on hosts such as Trusty.
77%
#2484 project loader: remove special LD_LIBRARY_FLAGS handling for classic snapcraft merged Merged PR #2484 (legacy branch, 2019) dropped the special classic-snap LD_LIBRARY_FLAGS handling in the project loader, which caused libc6 mismatches against the base snap. Same fix landed on master as #2485 (commit a8fce1ae5).
76%
#2485 project loader: remove special LD_LIBRARY_FLAGS handling for classic snapcraft merged Merged in #2485 as a8fce1ae5, removing obsolete classic LD_LIBRARY_FLAGS handling to prevent libc6 mismatches now that library crawling had improved.
73%
#1667148 Need a way to set LD_LIBRARY_PATH snapcraft (launchpad) closed Closed as obsolete: current snapd supports setting top-level LD_LIBRARY_PATH to $SNAP/lib and expands snap variables correctly.
72%
#1642041 LD_LIBRARY_PATH values are inconsistent when working with others snapcraft (launchpad) closed Closed as stale after builder-dependent runtime LD_LIBRARY_PATH entries caused inconsistent wrappers; a custom wrapper workaround was used, with no verified Snapcraft fix recorded.
72%
#1765482 Building a classic snap on trusty doesn't work snapcraft (launchpad) closed Trusty classic-snap build segfaults traced to core paths in LD_LIBRARY_PATH. Proposed fix PR canonical/snapcraft#2128 was closed unmerged as unnecessary, leaving the bug unfixed.
72%
#2049617 ubuntu-desktop-installer LD_LIBRARY_PATH not defined anymore snapcraft (launchpad) open Snapcraft 8 stopped injecting LD_LIBRARY_PATH into classic snaps, breaking ubuntu-desktop-installer rebuilds; the change is intentional, but a compatibility opt-in remains unresolved.
72%
#1665 patchelf to ignore LD_LIBRARY_PATH snapcraft closed Closed without a documented resolution. PR #1635 (commit da9181487) removed LD_LIBRARY_PATH leakage from classic wrappers, but no evidence confirms it closed #1665.
71%
#38 LD_LIBRARY_PATH hardcoded at snap creation time -- RPATH snapcraft closed Closed by maintainer sergiusens on 2015-11-16 in favour of Launchpad bug #1486623; no runtime-triplet or RPATH fix landed then. RPATH support later arrived for classic confinement in #1094, #1781 and #2085.
70%