Fail to run `glow` backend on NixOS
Describe the bug
My app fails to launch properly.
To Reproduce Steps to reproduce the behavior:
- Be on Nixos Unstable
git clone https://github.com/C0D3-M4513R/DexProtectOscRS.gitgit checkout dev(https://github.com/C0D3-M4513R/DexProtectOscRS/tree/dev)cd DexProtectOscRSnix develop --extra-experimental-features nix-command --extra-experimental-features flakescargo run --release
Expected behavior
My app launches.
Screenshots
[user@nixos:~/tmp/DexProtectOscRS-dev]$ cargo run --release
Updating git repository `https://github.com/emilk/egui`
Compiling emath v0.23.0 (https://github.com/emilk/egui?branch=master#fd75adb3)
Compiling ecolor v0.23.0 (https://github.com/emilk/egui?branch=master#fd75adb3)
Compiling epaint v0.23.0 (https://github.com/emilk/egui?branch=master#fd75adb3)
Compiling egui v0.23.0 (https://github.com/emilk/egui?branch=master#fd75adb3)
Compiling egui_glow v0.23.0 (https://github.com/emilk/egui?branch=master#fd75adb3)
Compiling egui-winit v0.23.0 (https://github.com/emilk/egui?branch=master#fd75adb3)
Compiling egui_tracing v0.2.1 (https://github.com/zakarumych/egui_tracing.git?rev=87ff66d75a47c1d372806f7d1c5fd60d986ba06b#87ff66d7)
Compiling egui_extras v0.23.0
Compiling eframe v0.23.0 (https://github.com/emilk/egui?branch=master#fd75adb3)
Compiling dex_protect_osc_rs v0.1.2 (/home/user/tmp/DexProtectOscRS-dev/app)
Finished release [optimized] target(s) in 1m 17s
Running `target/release/dex_protect_osc_rs`
2023-10-30T21:35:58.606481Z INFO dex_protect_osc_rs: Logger initialized
at app/src/main.rs:39
2023-10-30T21:35:58.606746Z TRACE mio::poll: registering event source with poller: token=Token(1), interests=READABLE
at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-0.8.9/src/poll.rs:543
2023-10-30T21:35:58.607317Z INFO dex_protect_osc_rs: Tokio Runtime initialized
at app/src/main.rs:42
2023-10-30T21:35:58.608229Z DEBUG eframe: Using the glow renderer
at /home/user/.cargo/git/checkouts/egui-5e4507fa4153be06/fd75adb/crates/eframe/src/lib.rs:226
2023-10-30T21:35:58.610487Z TRACE mio::poll: registering event source with poller: token=Token(0), interests=READABLE
at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mio-0.8.9/src/poll.rs:543
2023-10-30T21:35:58.611401Z DEBUG eframe::native::run: Entering the winit event loop (run_return)…
at /home/user/.cargo/git/checkouts/egui-5e4507fa4153be06/fd75adb/crates/eframe/src/native/run.rs:141
2023-10-30T21:35:58.611424Z DEBUG eframe::native::file_storage: Loading app state from "/home/user/.local/share/dexprotectosc-rs/app.ron"…
at /home/user/.cargo/git/checkouts/egui-5e4507fa4153be06/fd75adb/crates/eframe/src/native/file_storage.rs:46
2023-10-30T21:35:58.612010Z DEBUG eframe::native::run::glow_integration: trying to create glutin Display with config: ConfigTemplateBuilder { template: ConfigTemplate { color_buffer_type: Rgb { r_size: 8, g_size: 8, b_size: 8 }, alpha_size: 8, depth_size: 0, stencil_size: 0, num_samples: None, min_swap_interval: None, max_swap_interval: None, config_surface_types: WINDOW, api: None, transparency: false, single_buffering: false, stereoscopy: None, float_pixels: false, max_pbuffer_width: None, hardware_accelerated: None, max_pbuffer_height: None, native_window: None } }
at /home/user/.cargo/git/checkouts/egui-5e4507fa4153be06/fd75adb/crates/eframe/src/native/run.rs:471
2023-10-30T21:35:58.614811Z ERROR eframe::native::run: Exiting because of error: NoGlutinConfigs(ConfigTemplate { color_buffer_type: Rgb { r_size: 8, g_size: 8, b_size: 8 }, alpha_size: 8, depth_size: 0, stencil_size: 0, num_samples: None, min_swap_interval: None, max_swap_interval: None, config_surface_types: WINDOW, api: None, transparency: false, single_buffering: false, stereoscopy: None, float_pixels: false, max_pbuffer_width: None, hardware_accelerated: None, max_pbuffer_height: None, native_window: None }, Error { raw_code: None, raw_os_message: None, kind: BadConfig }) on event Resumed
at /home/user/.cargo/git/checkouts/egui-5e4507fa4153be06/fd75adb/crates/eframe/src/native/run.rs:201
2023-10-30T21:35:58.614832Z DEBUG eframe::native::run: Asking to exit event loop…
at /home/user/.cargo/git/checkouts/egui-5e4507fa4153be06/fd75adb/crates/eframe/src/native/run.rs:229
2023-10-30T21:35:58.614847Z DEBUG eframe::native::run: Received Event::LoopDestroyed - saving app state…
at /home/user/.cargo/git/checkouts/egui-5e4507fa4153be06/fd75adb/crates/eframe/src/native/run.rs:154
2023-10-30T21:35:58.614854Z DEBUG eframe::native::run: eframe window closed
at /home/user/.cargo/git/checkouts/egui-5e4507fa4153be06/fd75adb/crates/eframe/src/native/run.rs:252
Error in eframe whilst trying to start the application: Found no glutin configs matching the template: ConfigTemplate { color_buffer_type: Rgb { r_size: 8, g_size: 8, b_size: 8 }, alpha_size: 8, depth_size: 0, stencil_size: 0, num_samples: None, min_swap_interval: None, max_swap_interval: None, config_surface_types: WINDOW, api: None, transparency: false, single_buffering: false, stereoscopy: None, float_pixels: false, max_pbuffer_width: None, hardware_accelerated: None, max_pbuffer_height: None, native_window: None }. Error: Error { raw_code: None, raw_os_message: None, kind: BadConfig }
GUI exited. Thank you for using DexProtectOSC-RS!
Desktop (please complete the following information):
- OS: Nix Unstable
- Browser: firefox
- Version: 0.23.0 or master
Additional context
Did you find a solution for this? I've been having the same error (also on nixpkgs unstable)
I actually did. I found that nixos 23.05 doesn't have this issue. IDK if it matters, if the flake matches the system version for this.
I do also have some unstable bits in my system config, via a system flake, but the overall systemState is 23.05
Pretty sure I've managed to track it down to this commit from this PR. However I don't have the time to sit through hours worth of cache-miss build times ATM to identify exactly where it went wrong.
Edit: Ok so this might be weirder than I first thought, when updating my system at different commits:
1cf369a0dd162e2da454edd7880eb87bd4543eef(00:02 AM) does not workc7e70840c0ea981bc97a265b2294246dcc33775d(00:56 AM) does worka9e00367e77d2c0b9b6f7daf9abd0fe136f3cc57(1:34 AM) does not work
I'm pretty clueless as to what is happening here
@C0D3-M4513R @alexarice I know this sounds dumb but can you try simply running nix flake update for your project flake?
Seems like in the end the issue was a mismatch between the dependencies uses for building via the flake and the ones the system had.
I just created a new project, and updated my flake and system to 23.11 and ran nix flake update.
Otherwise I basically inherited the packaging as described above. I still get this error when launching from my ide:
Error in eframe whilst trying to start the application: Found no glutin configs matching the template: ConfigTemplate { color_buffer_type: Rgb { r_size: 8, g_size: 8, b_size: 8 }, alpha_size: 8, depth_size: 0, stencil_size: 0, num_samples: None, min_swap_interval: None, max_swap_interval: None, config_surface_types: ConfigSurfaceTypes(WINDOW), api: None, transparency: false, single_buffering: false, stereoscopy: None, float_pixels: false, max_pbuffer_width: None, hardware_accelerated: None, max_pbuffer_height: None, native_window: None }. Error: Error { raw_code: None, raw_os_message: None, kind: BadConfig }
and this one, when using a nix develop shell and running the resulting binary inside the dev-shell:
2024-01-30T12:13:20.527864Z DEBUG eframe: Using the glow renderer
at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/eframe-0.25.0/src/lib.rs:259
Error in eframe whilst trying to start the application: winit EventLoopError: the requested operation is not supported by Winit
however nix build does work correctly. So at least I can run it somehow. It is very inconvenient for developing the app though.
Seems like in the end the issue was a mismatch between the dependencies uses for building via the flake and the ones the system had.
Also isn't the entire purpose of the nix-store to ensure that this doesn't happen? Afaik the flake will pull it's dependencies into the nix store (if not already present) and create a link to that project somehow.
Also isn't the entire purpose of the nix-store to ensure that this doesn't happen? Afaik the flake will pull it's dependencies into the nix store (if not already present) and create a link to that project somehow.
Yes-ish. However I believe that there still needs to be some coherence for stuff like drivers as edge cases, it's not a truly fully self-contained system afaik.
Your app for example runs on my machine after switching the nixpkgs branch to match nixos-unstable (and a flake update) which is what I track on my system:
There's always the possibility I have something enabled that does magically fix this along with the previously mentioned flake update, but I'd wager that's unlikely. In any case you can peek at my nixos config and see if that's the case.
I feel like with the liked things in this issue there should be enough information for people to figure out, how to get egui to work on nixos.