Auto-connection for gnome-3-24 content interface

OK, that makes sense. I’ve renamed the slot to include the versions.

snap connect foo:gnome-3-26-1604 gnome-3-26-1604:gnome-3-26-1604

+1 to auto-connect that one.

+1

Granted auto-connection for this snap when the plugging snap’s ‘content’ field matches the slotting snap’s ‘content’ field. This is live now.

1 Like

@niemeyer and @kenvandine, since this is the first one of these with the new process, I want to be clear that the snap declaration is:

slots:
  content:
    allow-auto-connection:
      -
        plug-attributes:
          content: $SLOT(content)
        slot-attributes:
          content: gnome-3-26-1604

Importantly, we are allowing auto-connection of the slot with ‘content: gnome-3-26-1604’ when the plugging snap’s ‘content’ field matches the slot.

(Also using a one element list to make it easier for the store reviewer to add another slot in case the snap adds additional content slots, but that isn’t important for this conversation).

1 Like

it’s not clear to me where and how to utilise this. You say that “we are allowing auto-connection of the slot with ‘content: gnome-3-26-1604’ when the plugging snap’s ‘content’ field matches the slot.”. So what should our snapcraft.yaml look like? Do we need to make it match your yaml in the immediately preceding post, or is that yaml from some other place?

Currently I’ve defined in corebird’s snapcraft.yaml:

plugs:
  gnome-3-24-platform:
    interface: content
    target: gnome-platform
    default-provider: gnome-3-24:gnome-3-24-platform

Do I need to change that to just reference the new gnome-3-26-1604 snap? If I do would it look like:

plugs:
  gnome-3-26-1604-platform:
    interface: content
    target: gnome-platform
    default-provider: gnome-3-26-1604:gnome-3-26-1604-platform

Or do I need to know some other incantation?

That yaml is snap declaration yaml, not snapcraft yaml (which is why I pointed this out to an architect and the requesting publisher, not everyone).

Your existing yaml is close. This is what you need:

plugs:
  gnome-3-26-1604:
    interface: content
    content: gnome-3-26-1604
    target: gnome-platform
    default-provider: gnome-3-26-1604

The important thing is that you do either:

plugs:
  gnome-3-26-1604:
    interface: content

or:

plugs:
  something:
    interface: content
    content: gnome-3-26-1604

The latter explicitly declares the ‘content’ attribute of the plugged content interface. This is what must match for auto-connection. The former is a shorthand where the ‘content’ attribute isn’t specified, so the name of the plug is used for ‘content’ (so in that case, the name of the plug must match for auto-connection).

See:

4 Likes

Speaking of which, @kenvandine, it looks like https://wiki.ubuntu.com/snapcraft/parts is out of date and needs to be updated for the gnome-3-26-1604 content snap.

1 Like

gotcha, thanks :slight_smile:

I still don’t quite get on how I can use the gnome-3-26-1604 snap. Currently what I have in my snapcraft.yml is:

plugs:
  gnome-3-24-platform:
    interface: content
    target: gnome-platform
    default-provider: gnome-3-24:gnome-3-24-platform

I add the gnome-3-24-platform plug in the app section and also set after: [desktop-gnome-platform] in parts. Now if I just change the plug declaration to the gnome-3-26-1604 example above the snap will build, but on installation it still complains about the need to connect to gnome-3-24 since desktop-gnome-platform seems to rely on that.

Am I doing this wrong? Is there an updated version of desktop-gnome-platform needed or do I even need this at all?

In general I find it hard to find any info on this, the only thing having at least some documentation on using the content snap is https://wiki.ubuntu.com/snapcraft/parts, and even this is not very clear.

@phw I believe the plug needs to look like this:

plugs:
  gnome-3-26-1604:
    interface: content
    content: gnome-3-26-1604
    default-provider: gnome-3-26-1604
    target: gnome-platform

Before it’s auto-connected, you can manually establish the interface with:

snap connect foo:gnome-3-26-1604 gnome-3-26-1604:gnome-3-26-1604

Once you push the snap to the store and install from there, that command is unnecessary as the connection will be automatically established.

@kenvandine Is the above right?

2 Likes

That should be correct.

Thanks, it actually works. I think I was just confused by the default error message when running without connection, which said it needed a connection to gnome-platform with the following error message:

You need to connect this snap to the gnome platform snap.

You can do this with those commands:
snap install gnome-3-24
snap connect peek:gnome-3-24-platform gnome-3-24:gnome-3-24-platform
1 Like

Ah, it changed indeed, for the reasons discussed in this topic.

@kenvandine @willcooke The message needs tuning.

1 Like

Also, for people to be able to easily install Peek on Ubuntu, there needs to be an Ubuntu Software GUI for installing platform snaps. At the moment if someone tries to install Peek from Ubuntu Software and then run it graphically (from Ubuntu Software or from the Dash) it simply won’t load.

1 Like

@Ads20000 This is being fixed already. The content interface has a default-provider attribute which will be automatically downloaded if the interface has no other local connection options.

I’m not quite sure what you mean by that, bit too technical for me! But when is this being fixed, with the release of snapd 2.28 or is this perhaps fixed in revision 17 of the GNOME platform snap?

The auto download based on the default provider will be in a future snapd. I’ve submitted a fix for the guide text to snapcraft-desktop-helpers.

3 Likes

@Ads2000 In practice it means you’ll be able to do just “snap install peek” and it will all work fine.

2 Likes

Actually I think I get it, just took me a while to get my head round it: if there’s no other provider for the gnome-3-26-1604 content on the system then default-provider specifies where to get that content from and it’s downloaded and auto-connected. Sounds great!

So I note that’s been committed to the GitHub repo for snapcraft-desktop-helpers, what’s the release process for that repo? :slight_smile: