Snapcraft yaml options capabilities


#1

Hello snapcrafters :slight_smile:

I was referring to this part of the doc https://snapcraft.io/docs/snap-format to build my snap.yaml file and I found that a bunch of options triggered an error in snap, I wonder if the documentation is not uptodate, or if thoses options are deprecated, or is there a new way to use those features ? Here is a list :

base: core16 (does not work in my case snap 2.41 ubuntu 16.04LTS)
restart-delay :1s -> triggers an error
refresh-mode:skip-refresh | restart -> seems to be changed to endure | restart

All the best,


#2

How exactly does this not work for you? Also note that if you want an Ubuntu 16.04 based rootfs, you should use base: core (core operates as core16 for now)

This option is for an individual app in the snap, not for the root level snapcraft.yaml. Use it like this:

apps:
    svc:
        command: bin/service
        daemon: simple
        restart-delay: 1s

Same for refresh-mode.


#3

@theoriz what’s your snapcraft version? The latest stable is 3.8.


#4

Oh yeah, that’s that indeed, as mentioned in my post, my snap version is 2.41, I will investigate why I have such an old install on my system.

Tons of thanks for the quick replies !

edit : sorry did not mention my snapcraft version, it was indeed the apt old version


#5

You probably have the apt version installed:

sudo apt purge snapcraft
snap install snapcraft --classic

#6

Exactly ! Thanks a lot