The restriction of the `apps._app_name_.command` property is too strict

Bug #1820055 reported by 林博仁(Buo-ren, Lin) on 2019-03-14
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snapcraft
Undecided
Unassigned
snapd
Medium
Unassigned

Bug Description

I'm migrating a snap with a legacy snapcraft syntax to the new one with bases, however the previous command used to launch the application:

```yaml
    command: >
      bin/zenity
        --info
        --ok-label='Got it'
        --title='My Awesome App'
        --text='This is a demonstrative application for Snapcrafters Template Plus.\nIt indicates that the snapped application has been launched properly.'
        --window-icon="${SNAP}"/snap/gui/my-awesome-app.png
        --width=600
```

no longer work and causes the following Snapcraft error message:

```
Failed to generate snap metadata: The specified command 'bin/zenity\n --info\n --ok-label=\'Got it\'\n --title=\'My Awesome App\'\n --text=\'This is a demonstrative application for Snapcrafters Template Plus.\\nIt indicates that the snapped application has been launched properly.\'\n --window-icon="${SNAP}"/snap/gui/my-awesome-app.png\n --width=600\n' defined in the app 'my-app-name' does not match the pattern expected by snapd.
The command must consist only of alphanumeric characters, spaces, and the following special characters: / . _ # : $ -
```

although this problem can be easily workarounded by using a launcher we probably should reconsider whether we should impose a restriction to this property as it can be any arbitrary string.

description: updated
Changed in snapcraft:
milestone: none → 3.4

I encountered this problem again with `command: bin/guvcview --audio=pulse` (the `=` character seems to be the trigger)

Changed in snapcraft:
milestone: 3.4 → 3.5
Sergio Schvezov (sergiusens) wrote :

We are following the snapd restrictions now for command, I will add a snapd task to sort this.

John Lenton (chipaca) wrote :

I agree we want to lift this restriction.

I don't know when we'll find the time to do it (we need to make sure we're not using the fact it's restricted anywhere -- and we probably are).

Changed in snapd:
status: New → Confirmed
Sergio Schvezov (sergiusens) wrote :

Once snapd fixes the issue, snapcraft work can being to make sure we have end to end integration. Removing from the milestone until then.

Changed in snapcraft:
status: New → Confirmed
milestone: 3.5 → none
Ian Johnson (anonymouse67) wrote :

It looks like the characters being requested here are probably:

- =
- "
- '
- {
- }

In addition, I filed 1827392 against snapd for = and :, so we would have the additional character of

- :

Changed in snapd:
status: Confirmed → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers