← Back to issue list

snapcraft restricts version field too much

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1712061
Type
issue
State
closed
Author
~apachelogger
Labels
—
Created
Updated
Closed

Current evaluation

Version syntax stayed restricted. PR snapcore/snapcraft#1508 added the Store's missing 32-character limit, but requests for @, /, and spaces stalled without approval and the issue was closed.

Resolution: closed stale

Reason: Maintainer kyrofa marked the proposal Opinion on 2017-09-08 because of a lack of response; no change relaxed the character regex. PR snapcore/snapcraft#1508 addressed only the 32-character maximum, leaving the reported character restrictions unresolved.

Evaluated by: mr-cal-bot

No scores available.

Issue body

According to the metadata docs https://snapcraft.io/docs/snaps/metadata the version has no semantic value. Snapcraft, however, restricts the version field to match ^[a-zA-Z0-9.+~-]+$ which is generally sound as too not have too exotic strings, but is actually too restrictive given the version has no actual meaning which to me would suggest anything is fair game here. Reasonable version expressions I cannot have because of the (arbitrary?) restriction in snapcraft: master@87da2fcf1d0925f489985323303531507b5ed537 master:87da2fcf1d0925f489985323303531507b5ed537 fancy/Nested/Git/Branch+1.1 1.0 Alpha 1 1.0_Alpha_1 At KDE we are actually looking to codify both the git branch and oid in edge builds, which presently we'd have to do in an equally messed up format as we have with dpkg (+ and ~ thrown all over the place). Additionally, we have branches with forward-slashes in them, which are downright impossible to put the version right now. > Issues while validating snapcraft.yaml: The 'version' property does not match the required schema: 'Applications/17.08@87da2fcf1d0925f489985323303531507b5ed537' does not match '^[a-zA-Z0-9.+~-]+$'

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed stale Version syntax stayed restricted. PR snapcore/snapcraft#1508 added the Store's missing 32-character limit, but requests for @, /, and spaces stalled without approval and the issue was closed.
stealth/space-bunny-alpha — closed resolved Version validation was aligned with snapd’s documented format in snapcore/snapcraft#1924 (818eb0390); /, @ and whitespace remained invalid.
stealth/space-bunny-alpha — closed stale Closed as stale after nine years. PR #1508 (af16b802d) added the store's 32-character limit, but the requested relaxation of version characters was not implemented.
stealth/space-bunny-alpha — closed stale Closed as stale after about nine years without a fix or explanation; the restrictive version regex remained unchanged.
qwen3.6-35b-a3b-mtp-q6 — — Closed without comments or resolution. The request was abandoned, and the version field regex restriction remains unchanged. No fix or policy update was implemented.
qwen/qwen3.8-27b
Impact: 45
Quick Win: 29
Staleness: 95
Complexity: 35
Confidence: 55
Support Request: 15
needs triage Snapcraft's version field regex ^[a-zA-Z0-9.+~-]+$ blocks reasonable expressions (slashes, colons, spaces, @) that KDE wants for git branch/oid edge builds. No labels, comments, or maintainer activity since filing; still untriaged.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 25
Confidence: 80
Support Request: 10
close stale Request to relax snapcraft's version field regex to allow slashes, colons, and spaces for git refs. Issue is unlabelled, has zero maintainer comments, and is nearly 9 years old.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 15
Confidence: 85
Support Request: 5
close stale Request to relax snapcraft version field regex to allow slashes, spaces, and colons for git tracking. Unresponded to for nearly 9 years with no maintainer engagement or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 40
Confidence: 90
Support Request: 10
close stale Snapcraft's version field regex restricts complex version strings like git branch+commit hashes. Unlabelled, zero maintainer comments, inactive for nearly 9 years.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcore/snapcraft#1508 (confidence 96%)

    Added Store-compatible version-length validation, but did not allow the requested characters.

Related issues

Issue Project State Summary Similarity
#1777659 Snapcraft version string doesn't allow certain characters snapcraft (launchpad) open Snapcraft still rejects upstream-style 2018_931-01 because underscores are outside snap version grammar; the misleading "just for humans" wording remains and grammar changes span snapd, review-tools, and snapstore.
72%
#1590620 snapcraft can generage snaps with a name longer than 107 characters snapcraft (launchpad) open Snapcraft still accepts overlong snap names during project validation, allowing builds that the Store later rejects; the maintainer discussed shorter limits, but global enforcement is absent.
71%