Node snaps don't work out of the box with classic confinement

Bug #1706371 reported by Evan on 2017-07-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Medium
Sergio Schvezov

Bug Description

Snapcraft puts $SNAP/bin on $PATH when creating a strictly confined snap, but not on classic. This means that classic snaps using the node plugin won't find node out of the box:

$ heroku
/snap/heroku/485/bin/heroku: line 19: node: command not found

You have to explicitly include $SNAP/bin on the $PATH:

$ git diff
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 4caa0d5..1fbd2ac 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -8,7 +8,7 @@ confinement: classic

 apps:
     heroku:
- command: bin/heroku
+ command: env PATH=$SNAP/bin:$PATH heroku

 parts:
   hello-node-snap:

This is not discoverable. It requires understanding of the internals of classic confinement.

Sergio Schvezov (sergiusens) wrote :

This is because classic is just hard, you would need to compile your interpreter for this to work transparently. I am guessing this is because bin/heroku has a wrong shebang.

Changed in snapcraft:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Sergio Schvezov (sergiusens)
milestone: none → 2.35
Changed in snapcraft:
milestone: 2.35 → none
Changed in snapcraft:
status: Triaged → Fix Released
status: Fix Released → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers