← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1583259] Re: Snappy needs to influence environment variables in applications

 

** Changed in: snappy
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1583259

Title:
  Snappy needs to influence environment variables in applications

Status in Canonical Click Reviewers tools:
  Fix Released
Status in Snappy Launcher:
  Invalid
Status in Snapcraft:
  Triaged
Status in Snappy:
  Fix Released
Status in click-reviewers-tools package in Ubuntu:
  Fix Released
Status in click-reviewers-tools source package in Xenial:
  Fix Released
Status in click-reviewers-tools source package in Yakkety:
  Fix Released

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-tools =
  [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-example-env_0_all.snap
  ./snap-example-env_0_all.snap: pass

  [ 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-core-launcher (to actually apply
  those variables to each started process).

  As a bit of context, this is a wrapper for a non trivial but still
  common app: the calculator:

  https://bazaar.launchpad.net/~ubuntu-desktop/+junk/gnome-calculator-
  snap/view/head:/calc#L3

  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

To manage notifications about this bug go to:
https://bugs.launchpad.net/click-reviewers-tools/+bug/1583259/+subscriptions