Snappy needs to influence environment variables in applications
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Click Reviewers tools (obsolete) |
Fix Released
|
Undecided
|
Jamie Strandboge | ||
Snapcraft |
Fix Released
|
Wishlist
|
Sergio Schvezov | ||
Snappy |
Fix Released
|
Undecided
|
Unassigned | ||
snap-confine |
Invalid
|
Undecided
|
Unassigned | ||
click-reviewers-tools (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Yakkety |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
= SRU for snapcraft =
[Impact]
* Adding an environment keyword to snapcraft.yaml, which will make it to snap.yaml which the launcher will use to setup the environment.
* This reduces the amount of wrapper files.
[Test Case]
1. Run `snapcraft` on the ros demo.
2. Install the snap.
3. snap should run. (if it doesn't it mostly likely means the environent was setup incorrectly).
4. snap.yaml's `assumes` gets a `snap-run` tag.
[Regression Potential]
* Very low. Environment that was previously setup by wrapper scripts could be missing when the launcher launches using the environment keyword.
* The use of `assumes` will make sure this doesn't break people on older versions of snapd or snap-run
= SRU for click-reviewers
[Impact]
This is already fixed in the store so the SRU is for users to not see this failure their local system
[Test Case]
Run snap-review on the attached snap:
$ snap-review ./snap-
./snap-
[ Regression Potential]
Regression potential is extremely low since this is already on production in the Ubuntu Store for many weeks.
= Original description =
We see a common pattern across many snaps, all apps are really using wrappers to set environment variables. I'd like to propose that this is exposed as first class feature in snapcraft (same like plugs and slots), snappy (where interfaces can affect variables and snappy can have sensible defaults) and ubuntu-
As a bit of context, this is a wrapper for a non trivial but still common app: the calculator:
https:/
The wrapper is 44 lines long, all of which set up environment variables.
Support environment variable that would be available to snaps. The form should look like
snapcraft.yaml
name: ...
version: ...
...
environment: # these apply to all snaps
ENV1: value1
ENV2: value2
apps:
app1:
...
environment:
ENV1: value1 # takes precedence over global ones
These environment values would be transported to snap.yaml
tags: | added: snap-desktop-issue |
Changed in snapcraft: | |
milestone: | none → 2.10 |
description: | updated |
Changed in snapcraft: | |
importance: | Undecided → Wishlist |
status: | New → In Progress |
assignee: | nobody → Sergio Schvezov (sergiusens) |
description: | updated |
description: | updated |
Changed in click-reviewers-tools: | |
assignee: | nobody → Jamie Strandboge (jdstrand) |
Changed in snapcraft: | |
milestone: | 2.10 → 2.11 |
Changed in snapcraft: | |
milestone: | 2.12 → 2.13 |
Changed in snapcraft: | |
milestone: | 2.13 → 2.14 |
Changed in snapcraft: | |
status: | In Progress → Triaged |
Changed in snapcraft: | |
milestone: | 2.13 → none |
Changed in click-reviewers-tools (Ubuntu Xenial): | |
status: | New → In Progress |
description: | updated |
Changed in snappy: | |
status: | New → Fix Released |
Changed in snapcraft: | |
status: | Triaged → In Progress |
milestone: | none → 2.27 |
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
review tools supports environment in r678. Requested a store pull.