Problems creating snap package for KStars
Didier Roche
didrocks at ubuntu.com
Mon Jul 4 06:27:58 UTC 2016
Le 02/07/2016 20:40, Jasem Mutlaq a écrit :
> Hello,
Hey Jasem!
>
> I wanted to create a single snap package for KStars
> (http://edu.kde.org/kstars) including all dependencies. I started off
> from Krita's snapcraft.yaml file and customized it to fit KStars.
> However, since KStars leverages several KDE components (KNewStuff,
> kinit, kded5..etc) and also includes INDI server, drivers, and tools
> which communicate with devices for control and data acquisition, it is
> quite complex compared to other snaps I've seen so far.
Waow, you are attacking a great beast! Glad you are trying to figure out
how we could snap a component with so many system/session KDE
components! Good project :)
>
> At first, I ran it in strict confinement mode and used all the plugs
> necessary for it to work, but ran into several issues and used it in
> devmode since. The snap is created on my primary machine (64bit
> Kubuntu 16.04), and all testing is done on a fresh Ubuntu Mate 16.04
> Virtual Machine.
I would advise you to always start with devmode. Then, once your snap
works reasonably well, you can switch the confinement on and look at
missing plugs, errors and I so on.
>
> Thus far, I ran into the follow issues:
>
> 1. Cannot read from usr/share/indi. It keeps referring to $SNAP_DATA
> and $SNAP_USER_DATA but INDI is a 3rd party program that installs its
> data files to /usr/share/data, so how do I deal with that exactly?
> Where is $SNAP_DATA located with respect the root FS?
Most of the apps have either some runtime env variable or some package
build configuration (like --prefix or --datadir). One of the issue we
are discussing with upstream is that there is nothing that ensure you
those paths will stay the same. Gustavo (CCed here) mentioned maybe some
declarative open() redirection in libc would be in order.
To ensure directly to your question, SNAP_DATA is currently located at
/var/snap/<snap_name>/<current_snap_rev> (current/ is a symlink to
current_snap_rev directory).
You can have a quick look at those env variables by installing the
hello-world snap and run:
$ hello-world.env
>
> 2. Cannot play audio notifications: org.kde.knotifications: Audio
> notification requested, but sound file from notifyrc file was not
> found, aborting audio notification
We can have a look at that if you have this issue with the pulseaudio
plug, but let's quick out confinement for now.
>
> 3. Breeze icons installed but not loaded up. As indicated in the YAML
> file, the breeze icon theme is installed, but it is not loading up.
> Tried modifying qt5-launch file (export QT_QPA_PLATFORMTHEME=kde)
> tried changing QT_SELECT (snappy-qt5 vs qt5) but the icons never load up.
Interesting, we'll announce a new launcher in a couple of days, I have
hope that this one supports theme in a better way that the current
qt5-launch one. Stay tuned to this ML!
>
> 4. Download New Data (KNewStuff3) loads up providers, show download
> list, and when selecting a component to download, it downloads it but
> fails to install any file. In strict confinement mode, it fails to
> load the providers.xml file
I wonder where it tries to install them, is that by any chance in $SNAP?
(and so, in a read only area?)
>
> 5. dbus calls fail in strict confinement mode.
I'm ccing Jamie here, he may have a look at them if they make sense to
add to any interface.
>
> 6. Keep getting this message:
>
> XmbTextListToTextProperty result code -2
> XmbTextListToTextProperty result code -2
> XmbTextListToTextProperty result code -2
> XmbTextListToTextProperty result code -2
I confirm that one with other Qt projects. Didn't find a way personally
to fix this, maybe some other have more chance?
>
> 7. Other apparmor problems (see log below)
>
> Here is a link to the files:
>
> 1. snapcraft.yaml: http://www.indilib.org/jdownloads/snap/snapcraft.yaml
> 2. qt5-lunch: http://www.indilib.org/jdownloads/snap/qt5-lunch
> 3. AppArmor log: http://www.indilib.org/jdownloads/snap/apparmor.txt
>
>
> As you can see from the AppArmor log, there are a lot of calls been
> made among all the various components, libraries, file system..etc.
> Even when an executable like indi_simulator_ccd is accessing a
> dependent library, it says:
>
> = AppArmor =
> Time: Jul 2 20:30:33
> Log: apparmor="ALLOWED" operation="open"
> profile="snap.kstars.kstars//null-/snap/kstars/x2/usr/bin/indiserver//null-/snap/kstars/x5/usr/bin/indi_simulator_ccd"
> name="/snap/kstars/x5/usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2"
> pid=4015 comm="indi_simulator_" requested_mask="r" denied_mask="r"
> fsuid=1000 ouid=0
> File: /snap/kstars/x5/usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2 (read)
> Suggestion:
> * adjust program to read necessary files from $SNAP, $SNAP_DATA or
> $SNAP_USER_DATA
>
> Again, not sure how to adjust program to read from dependent library.
>
Same, needing Jamie's feedback on those :)
Cheers,
Didier
More information about the Snapcraft
mailing list