wayland-rs icon indicating copy to clipboard operation
wayland-rs copied to clipboard

Feature to avoid usage of `memfd_create`

Open jleibs opened this issue 1 year ago • 3 comments

Right now memfd_create appears to be used in a single place gated on certain platforms: https://github.com/Smithay/wayland-rs/blob/987c54453411a230e0147d2df3ef5354bb581b17/wayland-cursor/src/lib.rs#L439-L451

For other systems there appears to already be a fallback alternative.

Unfortunately, this creates a dependency on glibc > 2.26, which makes this incompatible with the conda build environment, forcing us to disable wayland support for those builds.

Given the minimal scope and existing fallback this seems like it could be a good candidate for a feature flag instead so we could avoid using it on platforms with an older glibc.

jleibs avatar May 18 '24 02:05 jleibs

So, you're seeing a link error due to glibc not having the memfd_create symbol?

Because I don't think that should happen. (With the latest version of wayland-rs.) rustix should be using direct system calls, unless the use-libc feature is enabled somewhere.

ids1024 avatar May 18 '24 02:05 ids1024

Exactly. We were getting a link error. Thanks for the pointers. I'll check the versions and see if we're using rustix tomorrow -- we might be one version behind.

jleibs avatar May 18 '24 02:05 jleibs

There might be an older version of wayland-rs somewhere in the dependency tree, from before we moved from nix to rustix.

ids1024 avatar May 18 '24 02:05 ids1024