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

nix shell in DEPENDENCIES.md does not work with wayland #2464

Closed
2 tasks done
henrispriet opened this issue Jun 16, 2024 · 0 comments · Fixed by #2465
Closed
2 tasks done

nix shell in DEPENDENCIES.md does not work with wayland #2464

henrispriet opened this issue Jun 16, 2024 · 0 comments · Fixed by #2465
Labels
bug Something isn't working

Comments

@henrispriet
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues.

Is this issue related to iced?

  • My hardware is compatible and my graphics drivers are up-to-date.

What happened?

  1. cargo init
  2. cargo add iced
  3. copy shell.nix from DEPENDENCIES.md
  4. nix-shell
  5. write a minimal hello world app:
// src/main.rs

use iced::{Application, Element, Sandbox};
use iced::widget::text;

struct App;

#[derive(Debug)]
enum Message {}

impl Sandbox for App {

    type Message = Message;

    fn new() -> Self {
        Self
    }

    fn title(&self) -> String {
        "Hello World!".to_string()
    }

    fn update(&mut self, _message: Self::Message) {}

    fn view(&self) -> Element<'_, Self::Message> {
        text("Hello World!").into()
    }
}

fn main() -> iced::Result {
    <App as Application>::run(Default::default())
}
  1. cargo run gives the following output:
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
     Running `target/debug/iced-app`
thread 'main' panicked at /home/henri/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_winit-0.12.2/src/application.rs:119:10:
Create event loop: Os(OsError { line: 80, file: "/home/henri/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.15/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoWaylandLib)) })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

What is the expected behavior?

The expected behaviour is that the hello world example runs

Version

crates.io release

Operating System

Linux

Do you have any log output?

No response

@henrispriet henrispriet added the bug Something isn't working label Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant