Cannot build Gradio snap

Hello, i want to release gradio as a snap package. However i cannot build it on “build snapcraft io”. I don’t have much experience with snap, so i need a bit help.

Source repository: https://github.com/haecker-felix/gradio-snap Build #79156: build. snapcraft. io/user/haecker-felix/gradio-snap/79156 Build log:

[…] Get:31 http:// ftpmaster.internal/ubuntu xenial-updates/universe Translation-en [210 kB]

Get:32 http:// ftpmaster.internal/ubuntu xenial-updates/multiverse armhf Packages [11.2 kB]

Get:33 http:// ftpmaster.internal/ubuntu xenial-updates/multiverse Translation-en [7540 B]

Fetched 16.4 MB in 6s (2720 kB/s) E:Unable to correct problems, you have held broken packages. Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Build failed Traceback (most recent call last): File “/usr/lib/launchpad-buildd/lpbuildd/target/build_snap.py”, line 215, in run self.pull() File “/usr/lib/launchpad-buildd/lpbuildd/target/build_snap.py”, line 177, in pull env=env) File “/usr/lib/launchpad-buildd/lpbuildd/target/build_snap.py”, line 86, in run_build_command ["/bin/sh", “-c”, command], get_output=get_output, echo=echo) File “/usr/lib/launchpad-buildd/lpbuildd/target/lxd.py”, line 392, in run subprocess.check_call(cmd, **kwargs) File “/usr/lib/python2.7/subprocess.py”, line 541, in check_call raise CalledProcessError(retcode, cmd) CalledProcessError: Command ‘[‘lxc’, ‘exec’, ‘lp-xenial-armhf’, ‘–’, ‘linux32’, ‘/bin/sh’, ‘-c’, ‘cd /build/75a0c51ae61746832478403b0a67db5b-xenial && env LANG=C.UTF-8 SNAPCRAFT_LOCAL_SOURCES=1 SNAPCRAFT_SETUP_CORE=1 http_proxy=http://snap-proxy.launchpad.net:3128 https_proxy=http://snap-proxy.launchpad.net:3128 GIT_PROXY_COMMAND=/usr/local/bin/snap-git-proxy snapcraft pull’]’ returned non-zero exit status 1 Revoking proxy token… RUN: /usr/share/launchpad-buildd/slavebin/in-target scan-for-processes --backend=lxd --series=xenial --arch=armhf SNAPBUILD-79157 Scanning for processes to kill in build SNAPBUILD-79157 RUN: /usr/share/launchpad-buildd/slavebin/in-target umount-chroot --backend=lxd --series=xenial --arch=armhf SNAPBUILD-79157 Stopping target for build SNAPBUILD-79157 RUN: /usr/share/launchpad-buildd/slavebin/in-target remove-build --backend=lxd --series=xenial --arch=armhf SNAPBUILD-79157

I don’t see what’s the problem here? :confused:

Greetings!

First thing I can think of, is I discovered a slight problem with adding GPG keys to apt within the build service. The yaml I sent to you includes:

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 399B698EEA9EF163B6F9A0F62CC98497A1231595

Which doesn’t work within the build service due to the restrictions on network communication. A minor tweak allows it to talk to the keyserver using HTTP which is permitted by the proxy:

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 399B698EEA9EF163B6F9A0F62CC98497A1231595

Thanks it’s building, now i have this wonderful message:

Error:human review required due to ‘deny-connection’ constraint for ‘slot-attributes’ from base declaration human review required due to ‘deny-connection’ constraint for ‘slot-attributes’ from base declaration

I think i just have to wait :slight_smile:

Hm. armhf builds are failing. Do you know why? amd64 seems to be working fine.

Build #79353

[…]
Get:33 http://ftpmaster.internal/ubuntu xenial-updates/multiverse Translation-en [7540 B]

Fetched 16.4 MB in 6s (2657 kB/s)
E:Unable to correct problems, you have held broken packages.
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Downloading parts list
Build failed
Traceback (most recent call last):
File “/usr/lib/launchpad-buildd/lpbuildd/target/build_snap.py”, line 215, in run
self.pull()
File “/usr/lib/launchpad-buildd/lpbuildd/target/build_snap.py”, line 177, in pull
env=env)
File “/usr/lib/launchpad-buildd/lpbuildd/target/build_snap.py”, line 86, in run_build_command
["/bin/sh", “-c”, command], get_output=get_output, echo=echo)
File “/usr/lib/launchpad-buildd/lpbuildd/target/lxd.py”, line 392, in run
subprocess.check_call(cmd, **kwargs)
File “/usr/lib/python2.7/subprocess.py”, line 541, in check_call
raise CalledProcessError(retcode, cmd)
CalledProcessError: Command ‘[‘lxc’, ‘exec’, ‘lp-xenial-armhf’, ‘–’, ‘linux32’, ‘/bin/sh’, ‘-c’, ‘cd /build/75a0c51ae61746832478403b0a67db5b-xenial && env LANG=C.UTF-8 SNAPCRAFT_LOCAL_SOURCES=1 SNAPCRAFT_SETUP_CORE=1 http_proxy=http://snap-proxy.launchpad.net:3128 https_proxy=http://snap-proxy.launchpad.net:3128 GIT_PROXY_COMMAND=/usr/local/bin/snap-git-proxy snapcraft pull’]’ returned non-zero exit status 1
Revoking proxy token…
RUN: /usr/share/launchpad-buildd/slavebin/in-target scan-for-processes --backend=lxd --series=xenial --arch=armhf SNAPBUILD-79353
Scanning for processes to kill in build SNAPBUILD-79353
RUN: /usr/share/launchpad-buildd/slavebin/in-target umount-chroot --backend=lxd --series=xenial --arch=armhf SNAPBUILD-79353
Stopping target for build SNAPBUILD-79353
RUN: /usr/share/launchpad-buildd/slavebin/in-target remove-build --backend=lxd --series=xenial --arch=armhf SNAPBUILD-79353

Did you check if the PPA you are using actually builds armhf binaries ? (if not, @kenvandine should probably enable them :wink: )

Seems not…

Can anybody enable it please? (ping @kenvandine :slight_smile:)

You probably noticed this yourself already, but for others following this thread, the snap declaration for using the DBus well-known for gradio is granted.

I have a small problem. If I install Gradio from the ubuntu software center, I can’t run it directly. I have to run it from a terminal:


snap run gradio
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 gradio:gnome-3-24-platform gnome-3-24:gnome-3-24-platform

(the ‘3-24’ number defines the platform version and might change)


After I have done this, everything is working fine. Why this isn’t done automatically?

there’s an ongoing discussion about that over at Auto-connection for gnome-3-24 content interface

Thanks. Second problem: MPRIS isn’t working. But it is declared in the snapcraft.yaml


slots: gradio: interface: dbus bus: session name: de.haeckerfelix.gradio gradio-mpris: interface: mpris name: gradio


https://github.com/haecker-felix/gradio-snap

I hope I don’t annoy you, with my problems :smiley:

I downloaded r6 of the gradio snap and see in snap interfaces that both the dbus and mpris interfaces are listed correctly:

$ snap interfaces
...
gradio:gradio                                -
gradio:gradio-mpris                          -
...

I also verified that the snap has the security policy from the mpris interface to allow the snap to be accessed via the MPRIS DBus API by unconfined (non-snap) processes.

Can you provide more details for ‘MPRIS isn’t working’? What are the steps to reproduce? Do you see any security denials in journalctl?

In using ubuntu 17.10. In the sound applet there should be a Gradio panel with pause / next / previous. I just tested the flatpak version of Gradio, and the MPRIS applet isn’t appearing too. So i think it isn’t a snap related problem. But it is a ubuntu specific problem, because I’m using fedora + flatpak version and everything is working fine (mpris). Now it is a bit tricky to find the problem :thinking:

It looks like the mpris plug is not automatically connected by snapd. You could try running snap connect gradio:gradio-mpris to see if that changes anything… (I think the command is right, but I might have the syntax wrong)

Huh there is a plug for mpris? I thought it would be a slot (as it is declared in the yaml https://raw.githubusercontent.com/haecker-felix/gradio-snap/master/snap/snapcraft.yaml).

sudo snap connect gradio:gradio-mpris
-> Snap gradio has no plug names “gradio-mpris”

However I found something in the journal:

Sep 12 17:40:54 hfvm indicator-sound[1895]: media-player-list-mpris.vala:66: unable to find application ‘de.haeckerfelix.gradio.desktop’

Fixed with the latest build. Already out on snap store stable.