servo / surfman

Accelerated offscreen graphics for WebGL
Apache License 2.0
173 stars 84 forks source link

examples `chaos_game` and `threads` not building, winit unresolved imports #237

Open dylanmc opened 2 years ago

dylanmc commented 2 years ago

In trying to track down a Metal issue with pathfinder, I'm trying to build and run the demos here. The offscreen demo builds and runs fine, but the chaos_game and threads demos both fail with the same compile errors:

   Compiling surfman v0.4.3 (/Users/.../surfman/surfman)
error[E0432]: unresolved imports `winit::DeviceEvent`, `winit::Event`, `winit::EventsLoop`, `winit::KeyboardInput`, `winit::VirtualKeyCode`
 --> surfman/examples/chaos_game.rs:9:13
  |
9 | use winit::{DeviceEvent, Event, EventsLoop, KeyboardInput, VirtualKeyCode};
  |             ^^^^^^^^^^^  ^^^^^  ^^^^^^^^^^  ^^^^^^^^^^^^^  ^^^^^^^^^^^^^^ no `VirtualKeyCode` in the root
  |             |            |      |           |
  |             |            |      |           no `KeyboardInput` in the root
  |             |            |      no `EventsLoop` in the root
  |             |            no `Event` in the root
  |             no `DeviceEvent` in the root

error[E0432]: unresolved imports `winit::WindowBuilder`, `winit::WindowEvent`
  --> surfman/examples/chaos_game.rs:10:13
   |
10 | use winit::{WindowBuilder, WindowEvent};
   |             ^^^^^^^^^^^^^  ^^^^^^^^^^^ no `WindowEvent` in the root
   |             |
   |             no `WindowBuilder` in the root

This is on macOS 12.1, rustc 1.58.0.

jdm commented 2 years ago

What version of winit does it say that you're building? Is it possible that you're using an ARM mac? You may need to try https://github.com/servo/surfman/pull/236.

dylanmc commented 2 years ago

It's building winit 0.24.0. I'm seeing the same behavior in this instance on both x86-64 and ARM macs. I tried #236, and got the same result. I have found that the versions of winit that don't build on ARM is anything < 0.24.0.

Edit: just reproduced the issue on Ubuntu 21.1