This thread got sidetracked to a different discussion, but I am seeing issues 
related to the original question.
I have a simple test app which looks like this in snapcraft .yaml:
apps:
  tester:
    command: usr/bin/echo-vars.sh
    environment:
      MY_RO_AREA: $SNAP
      MY_RO_AREA_BAD: $SNAP/etc/myro
      MY_RW_AREA: $SNAP_DATA
      MY_RW_AREA_BAD: $SNAP_DATA/myrw
    plugs: [ network, network-bind ]

The command simply echos the values of those variables like this:    echo 
"MY_RO_AREA = $MY_RO_AREA"


On Ubuntu-core the literal part of the string is doubled:

jwcoates@localhost:~$ snap run tester
MY_RO_AREA = /snap/tester/x1
MY_RO_AREA_BAD = /snap/tester/x1/etc/myro/etc/myro                   <<<<<<<<<
MY_RW_AREA = /var/snap/tester/x1
MY_RW_AREA_BAD = /var/snap/tester/x1/myrw/myrw                         <<<<<<<<<
jwcoates@localhost:~$ snap --version
snap    2.23
snapd   2.23
series  16
kernel  4.4.0-53-generic

On Ubuntu classic the $SNAP variables are not expanded (exact same snap 
executed):
netop@Snappy-Appliance:~$ sudo snap run tester
MY_RO_AREA = $SNAP
MY_RO_AREA_BAD = $SNAP/etc/myro
MY_RW_AREA = $SNAP_DATA
MY_RW_AREA_BAD = $SNAP_DATA/myrw

netop@Snappy-Appliance:~$ snap --version
snap    2.22.7
snapd   2.22.7
series  16
ubuntu  16.04
kernel  4.4.0-65-generic


Anyone else seeing this ?
Thanks,
Joe Coates

-----Original Message-----
From: snapcraft-boun...@lists.snapcraft.io 
[mailto:snapcraft-boun...@lists.snapcraft.io] On Behalf Of Kyle Fazzari
Sent: Friday, February 24, 2017 2:06 PM
To: snapcraft@lists.snapcraft.io
Subject: Re: snapcraft 2.27 has been released



On 02/24/2017 10:49 AM, Claudio André wrote:
>
> 2017-02-17 10:49 GMT-02:00 Sergio Schvezov
> <sergio.schve...@canonical.com <mailto:sergio.schve...@canonical.com>>:
>
>     Hello snapcrafters!
>
>     ## Setting up environment
>
>     No more wrapper scripts just to setup on environment entry, this is
>     now tied into an app entry in `apps`. Here's a quick example:
>
>     ```yaml
>     apps:
>         vim:
>             command: bin/vim
>             environment:
>                 VIMRUNTIME: $SNAP/share/vim/vim80
>     ```
>
>
> Hi, I tried to append to path (see below). It is not supported.
>
> ```yaml
>     environment:
>       PATH: "$SNAP/usr/lib/jvm/default-java/bin:$PATH"
> ```
>
> I'm ok with it. But, in case this is not by design, I'm mailing you guys.

I can verify this. To clarify, this builds and runs fine, but actually results 
in the PATH including the string `$PATH` instead of expanding it.

Can a snapd dev comment on this? Is that intended?

--
Kyle Fazzari (kyrofa)
Software Engineer
Canonical Ltd.
k...@canonical.com


________________________________

DISCLAIMER:
This e-mail and any attachments to it may contain confidential and proprietary 
material and is solely for the use of the intended recipient. Any review, use, 
disclosure, distribution or copying of this transmittal is prohibited except by 
or on behalf of the intended recipient. If you have received this transmittal 
in error, please notify the sender and destroy this e-mail and any attachments 
and all copies, whether electronic or printed.


-- 
Snapcraft mailing list
Snapcraft@lists.snapcraft.io
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/snapcraft

Reply via email to