snapcraft 2.27 cannot auto-infer command or library paths
Bug #1665927 reported by
Joseph Wakeling
This bug report is a duplicate of:
Bug #1670388: classic snap are missing some env variables for reaching command name. (snap build, executing it fails).
Edit
Remove
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
New
|
Undecided
|
Unassigned |
Bug Description
As of snapcraft 2.27, a typical app definition like the following:
apps:
dub:
command: dub
... will fail for classic snaps, because the command wrapper script no longer touches any environment variables (such as adding paths inside the snap to PATH). Instead, it is necessary to specify the full path of the command relative to the base directory of the snap (e.g. `bin/dub` in the case of the above example).
Ideally this should not be necessary: snapcraft knows what it's built and should be able to infer which command is being referred to, and it would be nice if it could auto-detect that `appname` means `$(SNAP)
To post a comment you must log in.
Hmm... I think it might be better to be less magic here.
I would suggest going the other way, and having the 'snapcraft init'
skeleton yaml guide people to the correct outcome. For example, if the
skeleton yaml looked like this:
name: my-snap-name # you will need to 'snapcraft register <my-snap-name>'
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line 79-character elevator pitch for your amazing snap
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # for edge/beta, becomes 'stable' for candidate/stable channels
confinement: classic # use 'devel' then 'strict' once you have plugs and
slots
#environment: # set env for all apps
# FOO: value
# BAR: value
#apps: snapcraft. io/docs/ daemons/
# my-app: # will be exported as snap.app in /snap/bin/
# command: path/to/binary # relative to root of $SNAP
# environment: # specific to this app
# BAZ: value
# my-daemon: # will start automatically
# daemon: simple # see http://
# command: bin/daemon # again relative to root of snap
parts:
my-part:
# See 'snapcraft plugins'
plugin: nil