WSL2 + gl has wayland error
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
0.6.0
## Operating system & version
Windows 11 WSL2
## What you did
run
```rust
use bevy::prelude::*;
fn main() {
App::new()
.insert_resource(WindowDescriptor {
width: 200.0,
height: 300.0,
..Default::default()
})
.insert_resource(bevy::render::options::WgpuOptions {
backends: Some(bevy::render::options::Backends::GL),
..Default::default()
})
.add_plugins(DefaultPlugins)
.run();
}
```
## What you expected to happen
I should see a black window.
## What actually happened
The program exits immediately.
## Additional information
I have narrowed the problem down [dispatch_pending](https://docs.rs/wayland-client/0.29.4/src/wayland_client/event_queue.rs.html#167-177) in the wayland-client library, which is a dependency of winit.
This calls [wl_display_dispatch_queue_pending](https://wayland.freedesktop.org/docs/html/apb.html).
Testing for `Display::protocol_error()` found no results and `errno` was set to a non descriptive `Connection reset by peer`.
It fails silently because winit until v0.26.1 doesn't output exit codes from the event_loop.
I post this here, because I couldn't replicate the problem with the wgpu examples that also use winit.
I think this is a relevant bug, because bevy has well known problems when using dynamic linking with the msvc toolchain and even if it works it's way slower than linux + mold linker.
Contributor guide
Research direction
Start by running the Rust reproduction on Windows 11 under WSL2 with Bevy 0.6.0 and the GL backend enabled, then inspect the winit event loop and the linked wayland-client dispatch_pending path. Done means the program no longer exits silently and either opens the expected black window or exposes a clear actionable error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100