`base: core22` `default-provider:` allows channels, but SnapD doesn't

Bug #2012057 reported by Michał Sawicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Fix Committed
Undecided
Unassigned

Bug Description

Snapcraft doesn't let you build a snap with a `default-provider:` that isn't available (yet):

```yaml
plugs:
  graphics-core22:
    interface: content
    target: $SNAP/graphics
    default-provider: mesa-core22
```

```shell
$ snapcraft
Launching instance...
Error installing snap 'mesa-core22' from channel 'latest/stable'.
Failed to execute pack in instance.
Full execution log: '/home/michal/.local/state/snapcraft/log/snapcraft-20230317-103905.303296.log'
```

It will happily build, if you give it a channel:

```yaml
default-provider: mesa-core22/edge
```

But then SnapD can't install it:

```shell
$ snap install graphics-test-tools --channel 22/edge
error: cannot perform the following tasks:
- Ensure prerequisites for "graphics-test-tools" are available (cannot install prerequisite "mesa-core22/edge": invalid instance name: invalid snap name: "mesa-core22/edge")
```

Snapcraft should either allow non-existent `default-provider:`s, or at least align with SnapD. Documentation does not mention channel support, so that's likely by design:

https://snapcraft.io/docs/content-interface#heading--default

Tags: craft-1655
tags: added: craft-1655
Revision history for this message
Sergio Schvezov (sergiusens) wrote :

we should not be allowing channels in snapcraft.yaml; perhaps we could with a big warning for bootstrapping purposes, if so, that should not make it to snap.yaml

Michał Sawicz (saviq)
Changed in snapcraft:
status: New → Confirmed
Michał Sawicz (saviq)
description: updated
Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Changed in snapcraft:
status: Confirmed → Fix Committed
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.