Incorrect default LD_LIBRARY_PATH
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned | ||
snapd |
New
|
Undecided
|
Unassigned |
Bug Description
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_
complex: ${LD_LIBRARY_
snapcrafts: ${LD_LIBRARY_
command: echo
parts:
my-part:
plugin: nil
override-build: |
touch ${CRAFT_
chmod 555 ${CRAFT_
```
Snapcraft sets the default top-level `environment.
```yaml
# snap/meta.yaml
environment
LD_LIBRARY_PATH: ${SNAP_
```
But there's no shell to interpret that expansion:
```shell
$ snap run --shell my-snap-
/var/lib/
$ snap run --shell my-snap-
/var/lib/
$ snap run --shell my-snap-
foo:/var/
$ snap run --shell my-snap-
$ snap run --shell my-snap-
$
```
As far I can tell, there's only simple string replacement happening.
This got introduced here:
https:/ /github. com/snapcore/ snapcraft/ pull/3758