Classic confinement for OpenChrom

https://github.com/OpenChrom/openchrom-snap is very similar to the Eclipse IDE as it is also an RCP application that bundles a special version of Java. It also contains Java FX. It is a heavy-duty file-based application and is basically an IDE for chemists. I made multiple attempts to run it in a sandbox in the confined branch. However, that snap is crashing at so many levels, I doubt it is even possible or worth the effort.

Hey @Mailaender,

Since classic confinement snaps run without restrictions, I would say it is worth taking a look at the errors/crashes you experienced while trying to run under strict confinement in case we can help you find missing interfaces. Have you tried snappy-debug?

From the snap description I see “OpenChrom® is an Open Source tool for the analysis and visualization of mass spectrometric and chromatographic data” so if you can provide more details about why you consider this snap needs classic it would be great.

Thanks!

That link is helpful, thank you. The application needs to read/write measurement data as well as logs. It also needs to launch new processes via Wine and collect resulting files from user configurable locations. Is that possible within confinement?

I also need to request permission for automatic

snap connect openchrom:openchrom-dot-dir

because otherwise the application fails to write logs and crashes.

Another problem I see is the back fall Gtk2 theme, which really looks bad.

Hey @Mailaender,

Could you please list the locations of the data/logs the application needs to read/write measurement data? There are various interfaces that can provide you accesses to specific locations such as home, personal-files, system-files and removable-media.

I have checked and I don’t see this in the latest uploaded revision. Are you plugging personal-files? let us know if you need read or write access to the openchro-dot-dir (which I assume is $HOME/.openchrom), so we can proceed with the voting and once it is completed, we can grant you the automatic connection.

Also, I am not very familiar with wine but I see see you could add wine as a stage-package. Have you tried so?

I experimented in here https://github.com/mailaender/openchrom-snap/tree/confined but it looks very broken like when no GTK theme is installed.

There are also dependencies unavailable: Missing library libudev.so.0

I gave up and wait for classic confinement to be approved now.

@Mailaender just because a snap requests classic confinement, that does not mean it will automatically be approved if you wait long enough. Instead you need to follow the Process for reviewing classic confinement snaps to explain why the snap requires classic confinement and then how it fits within one of the supported categories for classic confinement.

Can you please provide more details as to why specifically classic confinement is required referring to the process I mentioned earlier ?

Also regarding libudev.so.0 it looks like this is not packaged for Ubuntu 18.04 (and hence base: core18 snaps) however I see there is a package which you may be able to build from source as a separate part which wraps libudev.so.1 to provide this - https://github.com/archlinux/libudev0-shim

Can you give me a hint on how to allow spawning Wine processes inside confinement and how to fix the Gtk2 theming issues?

the wine side of things is described here (and since it uses the gnome extension it should also handle the theme):

I got so far that wine is included (thanks) however it does not work. No processes are spawned.

Both Gtk3/Gtk2… well, at least does not crash after many tries. However, the result is unacceptable. It is using ancient blocky themes, the fonts are unreadable

Applications are not meant to look like https://snapcraft.io/kompozer

/snap/openchrom/x7/snap/command-chain/desktop-launch: line 20: /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0: No such file or directory Directory ‘/home/matthias/snap/openchrom/x7/.local/share/mime/packages’ does not exist! ERROR: update-mime-database /home/matthias/snap/openchrom/x7/.local/share/mime exited abnormally with status 1 ERROR: /usr/lib/x86_64-linux-gnu/libgtk-3-0/gtk-query-immodules-3.0 exited abnormally with status 127

Gtk-Message: 17:23:24.434: Failed to load module “unity-gtk-module” Gtk-Message: 17:23:24.434: Failed to load module “canberra-gtk-module”

(java:31903): Gtk-WARNING **: 17:23:24.494: Unable to locate theme engine in module_path: “adwaita”,

(java:31903): Gtk-WARNING **: 17:23:24.494: Unable to locate theme engine in module_path: “pixmap”,

The confinement seems to do more harm than good.

well, did you switch to sommelier and the gnome extension ? seems like you are still using the deprecated desktop helpers and their desktop-launch script there …

I followed the official documentation at https://snapcraft.io/docs/gtk2-applications

Can’t use bin/sommelier as the applications launches wine processes. Only the location of the NIST AMDIS executable is configurable.

Hey @Mailaender,

Could you make any progress with spawning wine processes? Thanks!

No that didn’t work at all. However we updated the platform to Gtk3 which automatically made use of the system Gtk theme. Looks really polished now.

1 Like

@Mailaender this is great, so everything looks ok under strict confinement now? If that’s correct I will proceed to remove this request from our review queue. Could you please confirm this? Thanks!

Yes, I think we are fine with confinement. Thanks to all snapcrafters for their help.

1 Like