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

Bug #1706371 reported by Evan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Triaged
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.

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.