Minimum snapd version requirement for a snap

Hi,

The snap I am working on will require a minimum version of snapd because it needs a recently updated dbus policy on the mpris Interface.

What’s the correct way to enforce this from the snap at both install and run time? I see that I can add assumes: snapdx.y.z element to the snap’s snapcraft.yaml. Would this be an install time check only, or does it also happen when the snap runs?

Is there a good way for the snap to check the current snapd version at runtime so it can refuse to run if it doesn’t like it?

Thanks in advance.

assumes is an install time check and is the recommended way to handle this sort of thing

1 Like

Thanks, I will use it. Am I correct in assuming that there is no way to check this condition in the (unlikely) case that someone downgrades snapd after installing the snap (which requires a higher snapd version)?

Yeah unfortunately there is not a way to check that, we do have an open existing bug about this sort of situation, see https://bugs.launchpad.net/snapd/+bug/1835795 for a similar related bug

1 Like

Follow up question: How can I know when a specific commit in master will make it to a latest/beta build? I’m not familiar with the criteria you use to create a new release. Thanks! This is the commit: https://github.com/snapcore/snapd/commit/1416fce18be9d63ce70fb688883fcd338966592f

Hi, we actually have a somewhat documented release process, you can take a look at https://snapcraft.io/docs/snapd-release-process. Since the commit you referenced landed on master branch after we created the release branch for 2.53, it will go into the next major version of snapd 2.54 (unless there is an urgent need for it sooner, in which case we could cherry pick it onto the release/2.53 branch in which case it would go into snapd 2.53.5 if we do such a release).

I don’t know if I could make a case for urgency. I have an innefficient workaround, which I can use in the meantime to release my snap. On the other hand, I wouldn’t complain at all if that commit got cherry picked to the current major release :grin:. My snap would be less CPU intensive as a result. Thanks for all the info.

We can take a look at including that, it seems fairly small and unlikely to cause regressions for anyone else, but just an FYI regardless of what the next release is major or minor, it will only happen next year since most of Canonical will be away for winter holidays for 2 weeks

Yes the change is very isolated to mpris, I’d appreciate it if you could look into it. Understood about next year, vacation is good :+1:. Thank you again.