Issues in Alacritty (classic) snap

Hey There,

I’m working on this GH issue: https://github.com/tunix/alacritty-snap/issues/19

First we weren’t able to open nano. Fixed it by adding yet another library. But the issue owner made his point by trying to open GUI apps and that this is actually a general problem with the snap itself which I totally agree.

This is a classic app so it has access to various parts of the system. Initially, I thought that I only needed to embed dependencies that alacritty is statically compiled against. Things like fontconfig, libffi etc. With this amount of dependencies, alacritty seems to work. But now, I find myself adding other dependencies because some 3rd party app doesn’t work inside alacritty.

For starters, I added libtinfo6 and libncursesw6 libraries when nano didn’t work. Then I found out that I cannot start gedit or xeyes inside alacritty. If I use sudo, I’m able to run those apps. (nano related additions are in candidate channel as of now)

While trying to understand & fix the problems, I found @alexmurray’s emacs-snap and the forum posts he wrote. He started by using desktop-helpers and eventually got rid of it by adding some parts of it inside the snap. I followed a similar approach and now I’m able to run gedit without sudo. But I can’t run xeyes – (with sudo, I can)

What am I missing? Why can’t I run xeyes while I’m able to run gedit?

It seems from the context provided and looking at your snapcraft.yaml that the root of all your problems is setting LD_LIBRARY_PATH and that is rippling out into all these execution failures as the environment variables are leaking into other apps which is the problem that would need solving.

GLIB and other libraries change between OS releases. (18.04 -> 20.04 -> 21.04) I had problems with that and the GL libraries (as far as I remember).

What do you suggest for such issues?

rpaths are the way to go here, LD_PRELOAD if not.

I’ve no experience of patching binaries so this will be my first. :slight_smile: As @daniel suggested on the PR, I added patchelf package and tried to patch alacritty binary itself but it cannot find included libraries. Do you have any suggestions?

I can give this some attention next week (maybe even during a Snapcraft Clinic if you want). @cjp256 can you find a suitable time so we can figure this out with @tunix. I won’t be able to make it this week, but certainly next week and we might just need to swap the Clinic time so people from other regions can join.

2 Likes

That’d be awesome, thank you!