Public bug reported:
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-condition: always
cli:
command: chuck-norris-cli
3. Building and installing, executing:
$ chuck-norris-webserver-classic.cli
/snap/chuck-norris-webserver-classic/x2/command-cli.wrapper: 2: exec:
chuck-norris-cli: not found
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-norris-cli" instead of just "chuck-norris-cli"
works in classic and generate something like:
exec "$SNAP/bin/node" "$SNAP/bin/chuck-norris-cli" "$@"
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-norris-cli:
exec "$SNAP/bin/node" "$SNAP/bin/chuck-norris-cli" "$@"
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/python3/dist-packages/snapcraft/_baseplugin.py
usr/lib/python3/dist-packages/snapcraft/plugins/python.py]
ProcVersionSignature: Ubuntu 4.4.0-64.85-generic 4.4.44
Uname: Linux 4.4.0-64-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
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)
PackageArchitecture: all
SourcePackage: snapcraft
UpgradeStatus: Upgraded to xenial on 2014-10-31 (857 days ago)
** Affects: snapcraft
Importance: Undecided
Status: New
** Affects: snapcraft (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug xenial
** Also affects: snapcraft
Importance: Undecided
Status: New
** Summary changed:
- classic snap are missing some env variables for reaching command
+ classic snap are missing some env variables for reaching command name. (snap
build, executing it fails)
** Description changed:
1. Classic snap, where snapcraft.yaml can be found on
lp:~didrocks/+junk/chuck-norris-webserver-classic.
- 2. Note that it declares:
+ 2. Note that it declares and builds ok:
apps:
- node-service:
- command: chuck-norris-app
- daemon: simple
- restart-condition: always
- cli:
- command: chuck-norris-cli
+ node-service:
+ command: chuck-norris-app
+ daemon: simple
+ restart-condition: always
+ cli:
+ command: chuck-norris-cli
3. Building and installing, executing:
$ chuck-norris-webserver-classic.cli
/snap/chuck-norris-webserver-classic/x2/command-cli.wrapper: 2: exec:
chuck-norris-cli: not found
- The issue is that indeed, the wrapper don't add $SNAP/bin/ to $PATH:
+ 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-norris-cli" instead of just
"chuck-norris-cli" works in classic and generate something like:
exec "$SNAP/bin/node" "$SNAP/bin/chuck-norris-cli" "$@"
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-norris-cli:
exec "$SNAP/bin/node" "$SNAP/bin/chuck-norris-cli" "$@"
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/python3/dist-packages/snapcraft/_baseplugin.py
usr/lib/python3/dist-packages/snapcraft/plugins/python.py]
ProcVersionSignature: Ubuntu 4.4.0-64.85-generic 4.4.44
Uname: Linux 4.4.0-64-generic x86_64
NonfreeKernelModules: zfs zunicode zcommon znvpair zavl
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)
PackageArchitecture: all
SourcePackage: snapcraft
UpgradeStatus: Upgraded to xenial on 2014-10-31 (857 days ago)
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1670388
Title:
classic snap are missing some env variables for reaching command name.
(snap build, executing it fails)
To manage notifications about this bug go to:
https://bugs.launchpad.net/snapcraft/+bug/1670388/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs