snapcraft builds a snap that won't install if + is in the name

Bug #1693798 reported by Ben Romer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Released
Medium
Kyle Fazzari

Bug Description

If you build a snap with plus (+) in the snap name, the resulting snap file cannot be installed.

$ snapcraft init
Created snap/snapcraft.yaml.
Edit the file to your liking or run `snapcraft` to get started
$ cd snap/
$ ls
snapcraft.yaml
$ vi snapcraft.yaml

Change the name of the snap to something with a plus.

$ cat snapcraft.yaml
name: snap+bug # you probably want to 'snapcraft register <name>'
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
  This is my-snap's description. You have a paragraph or two to tell the
  most important story about your snap. Keep it under 100 words though,
  we live in tweetspace and your description wants to look good in the snap
  store.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

parts:
  my-part:
    # See 'snapcraft plugins'
    plugin: nil

$ snapcraft
Preparing to pull my-part
Pulling my-part
Preparing to build my-part
Building my-part
Staging my-part
Priming my-part
Snapping 'snap+bug' |
Snapped snap+bug_0.1_amd64.snap

Try to install it.

$ snap install --dangerous snap+bug_0.1_amd64.snap
error: cannot read snap file: invalid snap name: "snap+bug"

Tags: bitesize
Revision history for this message
Cris Dywan (kalikiana) wrote :

schema/snapcraft.yaml currently allows + in the pattern for the "name" property. This should be removed from the regular expression.

Changed in snapcraft:
status: New → Confirmed
tags: added: bitesize
Changed in snapcraft:
status: Confirmed → Triaged
Revision history for this message
Kyle Fazzari (kyrofa) wrote :
Changed in snapcraft:
status: Triaged → In Progress
assignee: nobody → Kyle Fazzari (kyrofa)
importance: Undecided → Medium
Changed in snapcraft:
status: In Progress → Fix Committed
milestone: none → 2.35
Changed in snapcraft:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.