danyspin97 / wpaperd

Modern wallpaper daemon for Wayland
GNU General Public License v3.0
332 stars 26 forks source link

NoWaylandLib #7

Closed samhh closed 2 years ago

samhh commented 2 years ago

Hi there! I'm seeing the following error:

$ wpaperd
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: NoWaylandLib
Location: src/main.rs:120

I'm running:

I've not got swaybg or anything else I could think of as pertinent running.

I'm using this NixOS derivation:

{ fetchurl, stdenv }:

stdenv.mkDerivation rec {
  pname = "wpaperd";
  version = "0.1.1";

  src = fetchurl {
    url = "https://github.com/danyspin97/wpaperd/releases/download/${version}/wpaperd-x86_64-unknown-linux-musl.tar.zst";
    sha256 = "12c874049c6b04c606746401dafe41d8c715988744747621333134690699fe16";
  };

  installPhase = ''
    mkdir -p $out/bin/
    mv ../wpaperd $out/bin/wpaperd
  '';
}

Could be a missing system dependency, a user permissions issue, I don't know. I tried this debug advice but the directory is empty.

If you have any ideas let me know, else I can clone and try debugging from source.

danyspin97 commented 2 years ago

Hi, thanks for the report!

By checking that the wpaperd executable did not link to libwayland-client.so, I assumed that it would use the rust implementation. However, after carefully re-reading the documentation, it seems that by default it uses the dlopen option:

Activating the dlopen implies use_system_lib, but additionnaly the crate will not explicitly link to libwayland-client.so and instead try to open it at runtime, and return an error if it cannot find it. This allows you to build apps that can gracefully run in non-Wayland environment without needing compile-time switches.

This is explains what is happening, if I have understood correctly your issue. I have changed wpaperd to use the rust implementation in the last commit. Can you please try again from source?

samhh commented 2 years ago

Success! Many thanks.

For anyone building with Nix(OS) you'll also need the libxbcommon and pkg-config packages as nativeBuildInputs.

danyspin97 commented 2 years ago

I am glad it works! I think libxbcommon has always been a dependency, it was just loaded at runtime using dlopen. I'll update the README.