Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add wayland and libxkbcommon to LD_LIBRARY_PATH #70

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EthnTuttle
Copy link

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
Copy link
Contributor

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
Copy link
Author

EthnTuttle commented May 31, 2024

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
Copy link
Author

@TonyGiorgio
Copy link
Contributor

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

@EthnTuttle
Copy link
Author

EthnTuttle commented Jun 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants