Sway - an i3 compatible wayland compositor

I’m not sure what you mean?

Currently, I run sway by installing it and wlroots from source manually.

Inside of sway i had to add all needed libraries.

Then every machine has different gpu’s with different needed packages.

Should i add all of them inside the snap or just use the libraries which are on the host.

Not sure.

You cannot safely use libraries from the host. Assuming you use core18 you will be linked against libraries from Ubuntu 18.04, if your snap is installed on Arch, then there is no reason to expect the host libraries and their dependencies to be ABI compatible.

You have to ensure that you have all the userspace libraries you need from the snap. (And also ensure that any executable from the you launch doesn’t pick up anything from the snap - so be careful with environment variables that affect this.)

thank you @alan_g

Good point.

Should i use mesa packages or better without mesa ?

There’s no perfect answer. Yet.

What I do with https://github.com/MirServer/egmde-snap/ is include the mesa userspace.

Mesa is pretty good at maintaining compatibility with the corresponding kernel modules, so this works across a range of hosts.

In contrast, the EGLstream userspace for Nvidia needs to be the same version as in the host kernel, and that’s impossible to guarantee.

2 Likes

@alan_g you’re my hero today! You had the secret ingredient I needed to make a snap I’ve been working on work (no-patchelf!) :smiley:

I think there is value in consolidating the best approach for incorporating OpenGL support into a snap, and so I put up a PR using your example to create an extension: https://github.com/snapcore/snapcraft/pull/2890

As support for OpenGL changes/improves over time, the extension can be updated accordingly.

1 Like

thank you :slight_smile: