Snapcraft 3.0.1 won't accept any version number? Must versions be quoted now?

At some point (snapcraft 3.x?), the version nazi decided that 0.1 was not a valid version. Wuffo?

$ cat /etc/issue
Ubuntu 18.04.1 LTS \n \l
$ sudo snap refresh
Alle Snaps sind aktuell.
$ snap list
Name       Version    Rev   Tracking     Publisher   Notes
core       16-2.36.2  6034  stable       canonical✓  core
core18     18         442   stable       canonical✓  base
multipass  2018.10.1  461   latest/beta  canonical✓  classic
snapcraft  3.0.1      2374  stable       canonical✓  classic
$ which snapcraft
/snap/bin/snapcraft
$ snapcraft
Issues while validating snapcraft.yaml: The 'version' property does not match the required schema: 0.1 is not a valid snap version string. Snap versions consist of upper- and lower-case alphanumeric characters, as well as periods, colons, plus signs, tildes, and hyphens. They cannot begin with a period, colon, plus sign, tilde, or hyphen. They cannot end with a period, colon, or hyphen.
$ grep version snap/snapcraft.yaml
version: 0.1

Changing that line to give a version of 1.0 or 1 produces same error message. Something’s so not right here.

Quoting the version number gets further. Is that a new requirement?

Yes, this is a new requirement if you start using the base keyword in snapcraft v3.0. This was a bug discovered in v2.x but we couldn’t change it without breaking folks, so we hid it behind the base keyword. To get the gist of the issue, say that you specify version: 1.10. To us software developers, that’s version “one dot ten”. To YAML, that’s the number 1.1. So we updated the schema to force versions to be strings so YAML and humans agree.

3 Likes

I thought this is already a thing in Snapcraft 2.x?