VisiCut icon indicating copy to clipboard operation
VisiCut copied to clipboard

Fix Visicut calling inkscape in an AppImage.

Open jnweiger opened this issue 1 year ago • 10 comments

In Ubuntu 20.04, this worked flawlessly. But only by chance. We use libraries from the host system, together with the binary inside the mounted appimage. in Ubintu 22.04, this crashes:

/tmp/.mount_inkscaYGPL8G/usr/bin/inkscape --version /tmp/.mount_inkscaYGPL8G/usr/bin/inkscape: error while loading shared libraries: libboost_filesystem.so.1.71.0: cannot open shared object file: No such file or directory

The fix is to not call the binary directly, but the AppRun script, which nicely prepares the environment. But then, AppRun also prints a message for the user to stdout, (instead of stderr). We now need to filter this, when parsing output from e.g. --version:

/tmp/.mount_inkscaYGPL8G/AppRun --version 2>/dev/null You should not use AppImage in production, but you can speedup the AppImage by following this guide: https://inkscape.org/learn/appimage/ Inkscape 1.3.2 (091e20e, 2023-11-25)

jnweiger avatar Apr 08 '24 08:04 jnweiger

This PR obsoletes https://wiki.fablab-nuernberg.de/index.php?title=VisiCut&action=edit&section=2

jnweiger avatar Apr 08 '24 08:04 jnweiger

I'll open a separate PR to fix the issues in the linux-checkinstall CI.

TheAssassin avatar Apr 08 '24 12:04 TheAssassin

Fix for the CI problems available in https://github.com/t-oster/VisiCut/pull/722.

TheAssassin avatar Apr 08 '24 12:04 TheAssassin

Please also report the stdout pollution as an upstream issue with Inkscape. We are probably not the only one affected by that.

( Side topics, not really relevant to this PR: What about the other combinations and directions - does calling Visicut from the AppImage Inkscape work correctly, even with all the AppImage environment variables? What if VisiCut is also an AppImage? )

mgmax avatar Apr 08 '24 17:04 mgmax

If someone opens an issue upstream, please ask them to just export INKSCAPE_VERSION=1234 for plugins.

TheAssassin avatar Apr 08 '24 20:04 TheAssassin

https://gitlab.com/inkscape/inbox/-/issues/10199

jnweiger avatar Apr 08 '24 22:04 jnweiger

( Side topics, not really relevant to this PR: What about the other combinations and directions - does calling Visicut from the AppImage Inkscape work correctly, ...

Yes, I believe most real-life combinations work. I have especially tested the case where both, Inkscape and VisiCut are AppImages.

jnweiger avatar Apr 08 '24 22:04 jnweiger

does calling Visicut from the AppImage Inkscape work correctly, ...

This is broken currently and will be working once this has been merged.

TheAssassin avatar Apr 09 '24 18:04 TheAssassin

What does "found" mean? Is that an officially supported environment variable provided by the Inkscape code? Is it an AppImage-specific feature?

TheAssassin avatar Apr 21 '24 21:04 TheAssassin

For Inkscape 1.3.x and 1.4.x (current / upcoming release), the AppImage sets INKSCAPE_COMMAND. https://gitlab.com/inkscape/inkscape/-/blob/1.4.x/packaging/appimage/AppRun?ref_type=heads#L40-44 This was added in 2022: https://gitlab.com/inkscape/inkscape/-/merge_requests/4751

For Inkscape 1.5.x (development branch) the AppImage is currently broken and fails to launch Python, so it is not possible to test. https://gitlab.com/inkscape/inkscape/-/issues/4851

Inkscape's inkex library for writing extensions has been using it since at least 1.0, so I guess that the normal Inkscape installation >= 1.0 also sets the variable. https://gitlab.com/inkscape/extensions/-/blob/master/inkex/command.py?ref_type=heads#L46

Once we drop support for AppImage-Inkscape < 1.3 and normal Inkscape < 1.0 (used e.g. on Ubuntu 20.04) we could throw out half of our extension code and instead use inkex.command and friends. Until then, I suggest to do it as above: Use INKSCAPE_COMMAND if available, else fall back to what we did before.

mgmax avatar Apr 22 '24 08:04 mgmax