← Back to issue list

Incorrect default LD_LIBRARY_PATH

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#2011842
Type
issue
State
open
Author
~saviq
Labels
Created
Updated
Closed

Current evaluation

Bug report about snapcraft not properly handling shell expansion in environment variables like ${LD_LIBRARY_PATH:-Foo}

Suggested action: needs triage

Reason: Issue is 1267 days old with zero maintainer response, no labels, and no assignee. It describes a legitimate bug with clear reproduction steps showing that shell expansion syntax in environment variables isn't being properly handled. However, without maintainer assessment, it cannot be categorized or prioritized yet.

Impact: 60 Quick Win: 36.0 Staleness: 85 Complexity: 40 Confidence: 50 Support Request: 10

Issue body

Given the following YAML: ```yaml name: env-bug base: core22 version: '0.1' summary: foo description: bar grade: devel confinement: strict apps:   hello-world:     environment:       plain: $LD_LIBRARY_PATH       bracketed: ${LD_LIBRARY_PATH}       prepended: foo:${LD_LIBRARY_PATH}       complex: ${LD_LIBRARY_PATH:-Foo}       snapcrafts: ${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}     command: echo parts:   my-part:     plugin: nil     override-build: |       touch ${CRAFT_PART_INSTALL}/foo       chmod 555 ${CRAFT_PART_INSTALL}/foo ``` Snapcraft sets the default top-level `environment.LD_LIBRARY_PATH` to: ```yaml # snap/meta.yaml environment   LD_LIBRARY_PATH: ${SNAP_LIBRARY_PATH}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ``` But there's no shell to interpret that expansion: ```shell $ snap run --shell my-snap-name.hello-world -c "printenv plain" /var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void $ snap run --shell my-snap-name.hello-world -c "printenv bracketed" /var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void $ snap run --shell my-snap-name.hello-world -c "printenv prepended" foo:/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void $ snap run --shell my-snap-name.hello-world -c "printenv complex" $ snap run --shell my-snap-name.hello-world -c "printenv snapcrafts" $ ``` As far I can tell, there's only simple string replacement happening.

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 60
Quick Win: 36.0
Staleness: 85
Complexity: 40
Confidence: 50
Support Request: 10
needs triage Bug report about snapcraft not properly handling shell expansion in environment variables like ${LD_LIBRARY_PATH:-Foo}
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 45
Confidence: 85
Support Request: 5
needs triage Bug report detailing incorrect string replacement for default LD_LIBRARY_PATH in Snapcraft, causing unexpected environment variable expansion. Unlabeled and unresponded to for over three years.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 5
needs triage Snapcraft incorrectly handles shell variable expansion in default LD_LIBRARY_PATH, performing literal string replacement instead. Unlabelled, zero comments, inactive for over three years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 65
Confidence: 85
Support Request: 10
needs triage Snapcraft incorrectly treats shell-style variable expansions in environment variables as literal strings instead of evaluating them. The report is unlabelled, has zero maintainer comments, and has been inactive for over three years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 92
Complexity: 35
Confidence: 80
Support Request: 5
close stale Snapcraft treats shell variable expansion syntax in default LD_LIBRARY_PATH as literal strings instead of evaluating them, causing unexpected environment values. The report is over 3 years old with no maintainer response or updates.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#4159 Environment stops working in snapcraft if defined snapcraft closed The regression causing PATH and LD_LIBRARY_PATH to disappear when defining environment variables in snapcraft.yaml was fixed in core22+.
71%
#1635 snap: remove leaking LD_LIBRARY_PATH snapcraft merged Removed leaking LD_LIBRARY_PATH from the snapcraft-classic wrapper, resolving Launchpad bug #1723208. The variable leaked into the environment, breaking snaps on distros like Trusty, and was redundant given existing rpaths. Approved and merged.
70%