Snaping Musescore

Hi! I was trying to get musescore snaped but reading the documentation I saw that:

Important Note: It is now necessary to install Qt 5.6, Qt 5.8, or later

And ubuntu 16.04 ships with Qt 5.5.1, so I was guessing how could I get it when building the snap.

I then saw parts qt57 and qt58 by tjyrinki:

But I think that they are “adapted” for the qmake & autotools plugins, am I wrong?

I need to use the cmake one so, do I have to write a modified version of it or there is an easier way to get (at least) Qt 5.6?

I also found this:

And a bug that is already opened here: https://bugs.launchpad.net/snapcraft/+bug/1670146

1 Like

I think getting a part would be better because then if you ask upstream to make builds it’s really easy for them because they can do it on build.snapcraft.io (which uses Ubuntu 16.04) but if no-one else comments to help you with this you could just use Ubuntu 17.04 (or 17.10 for potentially even more up-to-date dependencies) in an LXD container and make a Snap using that. Then, if you’ve made a working stable snap, you can ask upstream to use this guide to setup building Edge snaps automatically and pushing future releases to other channels.

Also you might want to edit the tag for this post to snap rather than snapcraft :slight_smile:

1 Like

I’d agree with @Ads20000, you’ll probably want something like the qt58/qt57 part extended for cmake. The Gist you mentioned is just one of my experiments, I don’t think it should be actually used in production :wink: The problem with those parts (qt58/qt57) is that they build Qt from scratch which takes some hours. Also, you’ll probably want to modify them to only include the Qt modules you need.

Thanks a lot for your tips @Ads20000 & @TimSueberkrueb !

After some more efforts I found out that a Qt version >= 5.6 is only needed when building the master branch, but not the current stable: 2.x

I now have a snapcraft file that uses the desktop-qt5 part and compiles the software: I still have to fiddle around with confinement and other things, but at least the application starts and seems to work (at least in my 5 minutes test)!

1 Like

Ok, I now got a version that works confined but I’m still seeing some denies:

$ sudo snappy-debug.security scanlog musescore                                         
kernel.printk_ratelimit = 0
= AppArmor =
Time: May 29 22:56:44
Log: apparmor="DENIED" operation="connect" profile="snap.musescore.mscore" name="/run/cups/cups.sock" pid=9927 comm="mscore" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=0
File: /run/cups/cups.sock (write)
Suggestions:
* adjust program to use $SNAP_DATA
* adjust program to use /run/shm/snap.$SNAP_NAME.*

= AppArmor =
Time: May 29 22:56:44
Log: apparmor="DENIED" operation="connect" profile="snap.musescore.mscore" name="/run/cups/cups.sock" pid=9927 comm="mscore" requested_mask="wr" denied_mask="wr" fsuid=1000 ouid=0
File: /run/cups/cups.sock (write)
Suggestions:
* adjust program to use $SNAP_DATA
* adjust program to use /run/shm/snap.$SNAP_NAME.*

And this errors:

$ musescore.mscore 
initScoreFonts 0x2b2cea0
QNetworkManagerInterface::QNetworkManagerInterface(QObject*) propsReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.135\" (uid=1000 pid=1
0211 comm=\"mscore \") interface=\"org.freedesktop.DBus.Properties\" member=\"GetAll\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=2805 comm=\"/usr/sbin/N
etworkManager --no-daemon \")"
QNetworkManagerInterface::QNetworkManagerInterface(QObject*) nmReply "An AppArmor policy prevents this sender from sending this message to this recipient; type=\"method_call\", sender=\":1.135\" (uid=1000 pid=1021
1 comm=\"mscore \") interface=\"org.freedesktop.NetworkManager\" member=\"GetDevices\" error name=\"(unset)\" requested_reply=\"0\" destination=\"org.freedesktop.NetworkManager\" (uid=0 pid=2805 comm=\"/usr/sbin/N
etworkManager --no-daemon \")"
"Object path cannot be empty"
Ignore SSL error: 6 The certificate has expired
Creating interface for ScoreView object
Violació de segment (bolcat de la imatge del nucli)

Regarding the deny: I thought that plugin the cups-control plug would be enough. Does anyone has any idea of why I’m seeing this deny?

And for the second one I’ve tried plugin the network-manager plug, but I’m getting the same errors…

cups-control should be enough (the socket is in the cups-client apparmor abstraction, which is used by the cups-control interface-- incidentally, there is a bug in snappy-debug not suggesting interfaces that have rules in included abstractions). This interface is manually connected; does ‘snap interfaces’ show that musecore is connected to this interface? If not, do:

$ sudo snap connect musescore:cups-control

As for the other denial, you need to plugs the ‘network-manager’ interface. Like cups-control, it is also manually connected. Usually (but not always), network-manager denials of this form don’t result in application failure.

That’s not very user-friendly to have to do manual connections though, how can we avoid this?

With the interfaces connected manually I’m not seeing any denials or errors when starting the application.

They require manual connections for a reason-- both give more access to the system than musecore actually needs, so the user needs to have input as to whether or not they should be connected. cups-control would allow musecore to configure printers and network-manager allows it to configure networking when all musecore needs is to be able to print or see if online.

Eventually musecore should use auto-connectable interfaces like Connectivity or Printing from Portals (or something else, like the ‘network-status’ interface). You are right that it isn’t very user-friendly atm; people are working on addressing the usability concerns so you don’t have to drop to a terminal to perform manual connections-- eg, there are forum topics on improvements to gnome-software to allow users to express their input wrt connections during the install process.

2 Likes

For reference: this GitHub Issue needs resolving for MuseScore to be built automatically on build.snapcraft.io and, thus, directly from upstream with no snapcrafter middleman :slight_smile:

1 Like