Specify the version of a stage-package to use

Hi,
I want to specify a particular version of the network-manager package for use by my own snap. What is the syntax for this if it is supported?
There was a related report:
https://bugs.launchpad.net/snapcraft/+bug/1811635

nmcli:
plugin: nil
stage-packages:
- network-manager
organize:
usr/bin/nmcli: bin/nmcli

I think that stage packages use the distribution matching the base snap as a “pool” of packages. Therefore you can only have one version of a given package (with a given name) in a given base.

Have you tried using stage-snaps with the network-manager snap?

You can set source to a specific deb file, this would get the specific version you need. This however has the drawback that any runtime dependencies would need to be handled manually.

hi all, just to be a bit more specific on the reason for this - we have two snaps that are both using nmcli to manage / monitor different network interfaces.

We also have two different target platforms, one x86 (Dell Edge Gateway 3002) and ARM (RasbPi 3 for dev).

The AppArmor error below is being thrown, which based on the thread here seems to be caused be a nmcli version mismatch.

This checks out, because running nmcli -v from within the snap shows version 1.2.6, whereas using network-manager directly on the CLI on the Dell Edge Gateway shows version 1.2.2 and on the RasbPi 3 shows version 1.20.4

Both snaps have the ‘base’ set to ‘core’.

If the version mismatch is in fact the issue, I guess we could build different versions of the snap for each platform with different versions of nmcli included, but this is obviously so we’re wondering if there’s a better way to tackle this.

nmcli-CRITICAL **: Error: Could not create NMClient object: An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=":1.37" (uid=0 pid=15775 comm=“nmcli dev “) interface=“org.freedesktop.DBus.Properties” member=“GetAll” error name=”(unset)” requested_reply=“0” destination=":1.12" (uid=0 pid=2347 comm="/snap/network-manager/379/usr/sbin/NetworkManager ")