classic snap are missing some env variables for reaching command name. (snap build, executing it fails)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Triaged
|
Low
|
Sergio Schvezov | ||
snapcraft (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
1. Classic snap, where snapcraft.yaml can be found on lp:~didrocks/+junk/chuck-norris-webserver-classic.
2. Note that it declares and builds ok:
apps:
node-service:
command: chuck-norris-app
daemon: simple
restart-
cli:
command: chuck-norris-cli
3. Building and installing, executing:
$ chuck-norris-
/snap/chuck-
The issue is that indeed, the wrapper don't add $SNAP/bin/ to $PATH:
#!/bin/sh
exec "chuck-norris-cli" "$@"
The non classic version works as it does add it to the path.
Note that specifying "bin/chuck-
exec "$SNAP/bin/node" "$SNAP/
4. Another side effect is that it's not the snap node version which is used in that case. The script declares "#!/usr/bin/env node" resolving to system one.
#!/bin/sh
exec "chuck-norris-cli" "$@"
-> will resolve to the system one, while if specified as bin/chuck-
exec "$SNAP/bin/node" "$SNAP/
I would expect in both case to prefer the snap version.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: snapcraft 2.27.1 [modified: usr/lib/
ProcVersionSign
Uname: Linux 4.4.0-64-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.1-0ubuntu2.5
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Mar 6 16:06:59 2017
InstallationDate: Installed on 2012-05-28 (1743 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
PackageArchitec
SourcePackage: snapcraft
UpgradeStatus: Upgraded to xenial on 2014-10-31 (857 days ago)
Changed in snapcraft (Ubuntu): | |
importance: | Undecided → Low |
These are the constraints of a classic snap. The developer of such snap would need to setup environment variables if needed to not accidentally pollute the environment. If execution is the problem, the use the relative path in prime to the command.