snap pack should validate default-providers

Bug #1917061 reported by Ian Johnson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Triaged
Medium
Unassigned

Bug Description

Currently you can run snap pack on a snap with snap.yaml like this:

plugs:
  kde-frameworks-5-plug:
    interface: content
    content: kde-frameworks-5-qt-5-15-core20-all
    target: kf5
    default-provider: kde-frameworks-5-qt-5-15-core20/latest/candidate

The intention here is clearly that the default-provider if not already installed on the system to install the snap from this latest/candidate channel, but the language currently does not allow this.

So for now, we should be more strict and don't allow snap.yaml to have channels specified like this, and in the future maybe we can expand the language to allow specifying a track for the default-provider snap.

This is especially unfortunate since the user experience of trying to install such a snap is as follows:

$ snap install kcalc --candidate
error: cannot perform the following tasks:
- Ensure prerequisites for "kcalc" are available (cannot install prerequisite "kde-frameworks-5-qt-5-15-core20/latest/candidate": invalid instance name: invalid snap name: "kde-frameworks-5-qt-5-15-core20/latest/candidate")

Changed in snapd:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Samuele Pedroni (pedronis) wrote :

The fix would be I think to add some minimal validation code for default-provider in BeforePreparePlug.

We need to be careful because another the syntax snap:slot is accepted but slot ignored.

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.