Smithay / smithay-clipboard

Provides access to the wayland clipboard for client applications
MIT License
29 stars 12 forks source link

Do not use dlopen by default #58

Open liferooter opened 7 months ago

liferooter commented 7 months ago

Using dlopen feature by default prevents the binary from dynamically linkage with wayland-client.so, making it harder to package such programs (e.g. for Nix, which automatically finds dynamically linked dependencies, but requires manual wrapping if dlopen is used) and makes it generally harder to track dependencies, giving no real advantages.

Please disable dlopen feature by default.

kchibisov commented 6 months ago

Yeah, but keep in mind that features in rust are additive, and e.g. winit always uses dlopen (though, you can disable it), which will force the dlopen on the user anyway and will enable dlopen in this crate, so it won't really help.

Also, from my point of view there's no desire to disable dlopen because it simplifies cross and dependency management, I understand though that nixOS folks are really noisy when it comes to dlopen, because what is LD_LIBRARY_PATH and why such loading exists is a hard for them to grasp. No offense, I'm just tired of nixOS users not being able to do simple things all over again.

You're running patchelf as the end command for the binary with the option to modify rpath it's clearly not an issue with packaging, and for regular dev env, you can automatically build the LD_LIBRARY_PATH and populate, which you'll need anyway, so you won't have to use patchelf. idk, improve the docs on nixOS to teach how to do such things, since when I used it, I always had to grep the nixpkgs sources to figure out basic things, and it still was not great.