flathub / net.ankiweb.Anki

https://flathub.org/apps/details/net.ankiweb.Anki
20 stars 13 forks source link

Multiple errors when running Anki from flathub #118

Closed mainrs closed 8 months ago

mainrs commented 8 months ago

The raw output contains following warnings and errors:

Here is the raw output:

❯ flatpak run net.ankiweb.Anki --version
F: Not sharing "/usr/share/themes/Catppuccin-Latte-Standard-Mauve-Light" with sandbox: Path "/usr" is reserved by Flatpak
ERROR: ld.so: object '/usr/lib/libinput-config.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Anki starting...
Initial setup...
Running with temporary Qt5 compatibility shims.
Run with DISABLE_QT5_COMPAT=1 to confirm compatibility with Qt6.
Preparing to run...
Anki 2.1.66

The first point seems to be pretty easily fixable. Just adding the dependency to the flathub package. The second one I do not really understand. What does it mean? The third point I also do not understand. It has nothing to do with this package, but since I am already on an issue tracker with people that know how flatpak works, I thought I might ask as well.

P.S.: Is there a generic way to inject more dependencies into a flathub package? For example, if an addon needs a specific CLI tool installed.

rayes0 commented 8 months ago

These warnings seem fine and should not impede app function.

As for running a CLI tool from an addon, the easiest way I can think of is adding the host-os permission, and adding /var/run/host/bin to PATHin the sandbox. This will obviously weaken the sandbox. If you are able to modify the addon, take a look at https://docs.flatpak.org/en/latest/flatpak-command-reference.html#flatpak-spawn.

mainrs commented 8 months ago

Concerning point 1, I did not change my LD_PRELOAD path. The only changes I do sometimes apply are environment variables related to HiDPI and the windowing system configuration. I use Flatseal for all my changes.

Concerning point number 3, I am doing this for a theme, that is correct. As of now, the theming of flatpak apps does not match the theming of my whole system. I tried giving it access to /usr/share/themes/, since that's where my GTK themes are stored.

rayes0 commented 8 months ago

Does the LD_PRELOAD happen with all flatpaks, or only this one?

As for the themes, /usr is a blacklisted path since its already used in the sandbox and so can't be forwarded at the same location in the sandbox. You will need to either set host-os and point your apps to use the theme in /var/run/host/usr, or install the themes into your home directory ~/.themes or somwhere similar that your apps recognize, and set the filesystem=home:ro permission (/home is not blacklisted and will get forwarded directly to /home in the sandbox).

rayes0 commented 8 months ago

Since these issues seem specific to your system and not issues with this flatpak in general, closing this issue for now, but feel free to keep commenting if you need more help.