Auto-connection for gnome-3-24 content interface

Yeah i think it needed, not everyone gonna install and open snap from terminal!!

It should be solved.

We need some feedback from the desktop team on the proposal above.

@kenvandine @seb128 @willcooke What’s the status here?

I’m happy enough with the short term solution of the naming schema of gnome-3-24-1604 and gnome-3-26-1604.

One question related to distros, is it implied that snaps in the Ubuntu store are built on the Ubuntu base? Other distros would actually use other stores right?

There are no other stores and there are currently no plans to add support for other stores (because there are many other features that need to take priority). See the discussion here.

Other distros would use their respective base snap …
(once base snaps exist all currently existing snaps will likely be automatically tied to the Ubuntu base snap (which will just be a split of the current core snap AIU) though, new snaps could define to use a different base snap for their respective distro)

@kenvandine There’s no such thing as an Ubuntu Store. What we have is a Snap Store, and the namespace is global. Today snaps are all making use of a core snap which has binaries compiled originally in Ubuntu 16.04, but even that is being opened up, and we’ll have that base snap explicitly defined for each snap. That means people will be able to install a snap based on OpenSUSE binaries in Ubuntu, and vice-versa.

In terms of the connections, can we please go ahead and perform the migration to those names so that we can auto-connect them going forward then?

2 Likes

I’ve created a new snap for GNOME 3.26 named gnome-3-26-1604 (in edge channel). I’ve also dropped the redundancy in the slot name.

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

How does that sound?

1 Like

Per notes above and in the explanation in the video, we need the name in the content interface as otherwise anything can connect to anything else, compatible or not.

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