← Back to issue list

Library discovery for rpath patching needs to be deterministic

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1759740
Type
issue
State
open
Author
~kyrofa
Labels
—
Created
Updated
Closed
—

Current evaluation

RPATH patching still resolves duplicate SONAMEs with an unsorted os.walk, so Snapcraft may choose a library contrary to ld precedence; this maintainer-authored issue remains open.

Suggested action: keep open

Reason: The current snapcraft/elf/_elf_file.py implementation remains affected: _Library._crawl_for_path() walks each search root with os.walk() and returns the first valid match without first applying ld-ordered common library directories. The issue provides a concrete four-path collision and a specific required behavior, while its maintainer authorship and the absence of any resolving commit or PR indicate it should remain open.

Evaluated by: mr-cal-bot

Impact: 58 Quick Win: 23 Complexity: 56 Confidence: 96 Actionability: 90

Issue body

Given a snap with four different versions of libfoo, located in usr/lib/libfoo.so, usr/lib/x86_64-linux-gnu/libfoo.so, lib/libfoo.so, and lib/randomdir/libfoo.so, Snapcraft will find an executable that wants to link to libfoo.so and may determine any one of these are a match in a directory walk that isn't deterministic and certainly doesn't behave like ld. We need to walk the entire snap looking for libraries so that we find them in odd places, but we need to first look in common directories, in the order that ld would find them, and maintain that consistency.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 58
Quick Win: 23
Complexity: 56
Confidence: 96
Actionability: 90
keep open RPATH patching still resolves duplicate SONAMEs with an unsorted os.walk, so Snapcraft may choose a library contrary to ld precedence; this maintainer-authored issue remains open.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 14
Complexity: 50
Confidence: 70
Actionability: 70
keep open Library discovery for rpath patching is non-deterministic when multiple library versions exist; needs to follow ld search order for consistency.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 22
Staleness: 85
Complexity: 55
Confidence: 55
Support Request: 5
needs triage Snapcraft's rpath patcher may pick the wrong of several same-named libraries in a snap because its directory walk is nondeterministic and doesn't follow ld.so search order. Filed by a maintainer ~8.4 years ago; no labels, comments, or activity since.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 45
Confidence: 90
Support Request: 10
close stale Request for deterministic library discovery in Snapcraft's rpath patching to match ld behavior. Unaddressed for ~8 years with no comments or labels.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 65
Confidence: 85
Support Request: 15
close stale Snapcraft's rpath patching library discovery is non-deterministic when multiple library versions exist across different paths. The report requests prioritizing standard ld search paths for consistency. Open for over 8 years with no maintainer interaction.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 55
Confidence: 70
Support Request: 5
close stale Snapcraft's rpath patching library discovery is non-deterministic across multiple library paths. Requests a deterministic walk matching ld order. Unlabelled and inactive for over 8 years.

Update history

Date Change
created

Related issues

No related issues found above the similarity threshold.