HarborWallet / harbor

Ecash management tool
https://harbor.cash
MIT License
133 stars 17 forks source link

fix: add wayland and libxkbcommon to LD_LIBRARY_PATH #70

Open EthnTuttle opened 5 months ago

EthnTuttle commented 5 months ago

Running Ubuntu 22.04 and encountered:

thread 'main' panicked at /home/ethan/.cargo/git/checkouts/iced-f01cba4d5e61fd0a/b30d34f/winit/src/application.rs:153:10:
Create event loop: Os(OsError { line: 81, file: "/home/ethan/.cargo/git/checkouts/winit-57d3141eaf559308/8affa52/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoWaylandLib)) })

This resolves it but I now encounter:

└─▪ just run
RUST_LOG=harbor=debug,iced_wgpu=error,wgpu_core=error,info cargo run 
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.22s
     Running `target/debug/harbor`
 WARN  sctk_adwaita::buttons > Ignoring unknown button type: 
thread 'main' panicked at /home/ethan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.19.4/src/instance.rs:521:39:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Putting into draft PR and will attempt more iterations in the future.

TonyGiorgio commented 5 months ago

Interesting, this helps! Seems like a better sign. I had attempted some more LD lib path stuff previously but didn't get anywhere:

https://github.com/MutinyWallet/harbor/pull/4/files#diff-206b9ce276ab5971a2489d75eb1b12999d4bf3843b7988cbe8d687cfde61dea0

Not much in terms of documentation or help with nix & iced unfortunately

EthnTuttle commented 5 months ago

Looks like I'm missing a gpu lib or something. Here's the code from the panic I encountered after fixing Wayland.

        let mut hal_surface: Option<Result<AnySurface, hal::InstanceError>> = None;

        #[cfg(vulkan)]
        if hal_surface.is_none() {
            hal_surface =
                init::<hal::api::Vulkan>(&self.instance.vulkan, display_handle, window_handle);
        }
        #[cfg(metal)]
        if hal_surface.is_none() {
            hal_surface =
                init::<hal::api::Metal>(&self.instance.metal, display_handle, window_handle);
        }
        #[cfg(dx12)]
        if hal_surface.is_none() {
            hal_surface =
                init::<hal::api::Dx12>(&self.instance.dx12, display_handle, window_handle);
        }
        #[cfg(gles)]
        if hal_surface.is_none() {
            hal_surface = init::<hal::api::Gles>(&self.instance.gl, display_handle, window_handle);
        }

        //  This is only None if there's no instance at all.
        let hal_surface = hal_surface.unwrap()?;

Will look into a Nix fix for this.

EthnTuttle commented 5 months ago

Might be something here: https://gitlab.com/tad-lispy/rust-bevy-playground/-/commit/35965a2d1e1d7db925950d91c49c4ad52cc1dca8

Will look later.

TonyGiorgio commented 5 months ago

Just merged something in that might have fixed it for you? Could you check on the master branch again.

EthnTuttle commented 5 months ago

Just merged something in that might have fixed it for you? Could you check on the master branch again.

New new error:

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 42.40s
     Running `target/debug/harbor`
 WARN  sctk_adwaita::buttons > Ignoring unknown button type: 
 WARN  wgpu_hal::gles::egl   > EGL_MESA_platform_surfaceless not available. Using default platform
thread 'main' panicked at /home/ethan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:789:88:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: Recipe `run` failed on line 8 with exit code 101
            } else {
                log::warn!("EGL_MESA_platform_surfaceless not available. Using default platform");
                let display = unsafe { egl.get_display(khronos_egl::DEFAULT_DISPLAY) }.unwrap();
                (display, None, WindowKind::Unknown)
            };
            ``

looking...

FWIW, running on a Lenovo ThinkPad P16 Gen 1