Totally misleading error on non-string version
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
Low
|
Facundo Batista |
Bug Description
I had this in my snapcraft.yaml:
version: 8.1
the error it gave me was:
Issues while validating snapcraft.yaml: The 'version' property does not match the required schema: 8.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.
However, my 8.1 totally matched what was described there!!!
Turns out (I guess) that the problem was that it was a number, I changed it to
version: "8.1"
and it seems to work ok now.
So, snapcraft should first check if it's a string or not, and error out with something like "The 'version' property needs to be a string, found a float".
Changed in snapcraft: | |
assignee: | nobody → Facundo Batista (facundo) |
status: | New → In Progress |
summary: |
- Totally misleading error on 8.1 version + Totally misleading error on non-string version |
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
Changed in snapcraft: | |
status: | Fix Committed → Fix Released |
https:/ /github. com/snapcore/ snapcraft/ pull/2497