johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
5.26k stars 256 forks source link

Container support #1262

Open avidseeker opened 4 months ago

avidseeker commented 4 months ago

I'm launching foliate within a chroot environment (systemd-nspawn). The chroot is set up for launching X11 applications. E.g: tested on Firefox.

It seems that it is dependent on dbus? Curious why it needs dbus, and whether there is a way to remove that dependency?

$ foliate book.epub
MESA: error: Failed to query drm device.
libEGL warning: egl: failed to create dri2 screen
libEGL warning: DRI2: could not open /dev/dri/card1 (No such file or directory)
MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)
libEGL warning: egl: failed to create dri2 screen
MESA: error: Failed to query drm device.
glx: failed to create dri3 screen
failed to load driver: iris
failed to open /dev/dri/card1: No such file or directory
failed to load driver: i965
MESA: error: Failed to query drm device.
libEGL warning: egl: failed to create dri2 screen
libEGL warning: DRI2: could not open /dev/dri/card1 (No such file or directory)
MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)
libEGL warning: egl: failed to create dri2 screen
bwrap: Can't mount proc on /newroot/proc: Operation not permitted

** (com.github.johnfactotum.Foliate:469): ERROR **: 00:11:49.545: Failed to fully launch dbus-proxy: Child process exited with code 1
zsh: trace trap (core dumped)  foliate book.epub
johnfactotum commented 3 months ago

Foliate doesn't depend on DBus directly. It's probably used by WebKitGTK.

archisman-panigrahi commented 2 months ago

@johnfactotum This comment fixed the issue with Foliate installed from deb package/ppa. https://github.com/johnfactotum/foliate/issues/1271#issuecomment-2016575770

How about manually adding the file /etc/apparmor.d/foliate to the .deb package/PPA?

archisman-panigrahi commented 2 months ago

Alternatively I can add a new hotfix package to the PPA which will install the /etc/apparmor.d/foliate file, and foliate will pull that hotfix package as a dependency.

johnfactotum commented 2 months ago

I would be hesitant to do that as it seems like a workaround that could be potentially unsafe. It'd be better if one can fix the underlying issue, though I'm not sure what that is. Probably Bubblewrap, used by WebKitGTK, has problem running in AppArmor.

archisman-panigrahi commented 2 months ago

Similar issue reported for VS Code in Ubuntu 24.04. However, I am unsure if the proposed apparmor fix for vscode will also fix the Foliate issue. https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2056517

I reported a Launchpad bug against apparmor for Foliate https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/2060767