dtcristo / bevy_pixels

Bevy plugin that uses Pixels (a tiny pixel buffer) for rendering
https://docs.rs/bevy_pixels
Apache License 2.0
84 stars 12 forks source link

Build failure after adding bevy_pixels to project. #9

Closed merehap closed 2 years ago

merehap commented 2 years ago

I just added this to my Cargo.toml on PopOS Linux: bevy = { version = "0.6", default_features = false } bevy_pixels = "0.3"

(Swapping in bevy 0.6.1 doesn't change anything.)

The result was this error message:

error: Please select a feature to build for unix: x11, wayland --> /home/sean/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.26.1/src/platform_impl/linux/mod.rs:10:1 | 10 | compile_error!("Please select a feature to build for unix: x11, wayland"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is the same problem that this other project is facing: https://github.com/StarArawn/bevy_tiled/issues/65

I modified the bevy dependency as mentioned in that ticket to: bevy = { version = "0.5", default-features = false, features = ["x11"] } and everything worked.

Potential fix here, but it presumably won't work well for wayland users: https://github.com/StarArawn/bevy_tiled/pull/66/files

But of course that step shouldn't be required if possible. Could you take a look at how to remove this hiccup from the linux installation process? Thanks!

dtcristo commented 2 years ago

I've implemented this in 0.4.0. Please let me know if you have further issues.

adsick commented 2 years ago

Hi, I also had this issue, then mentioned features = ["wayland"], but then this: image

my workspace config is this: bevy_pixels is in bevy/crates directory, the dependencies of bevy_pixels are:

  14   │ [dependencies]
  15 ~ │ bevy = { path = "../../", version = "0.6", default_features = false, features = ["bevy_winit", "wayland"] }
  16   │ pixels = "0.9"

note, I'm using such workspace config because it saves time for not compiling bevy multiple times

dtcristo commented 2 years ago

I'm not on Linux so can't really look into this issue. If you manage to fix it, I'd be happy to merge a PR.

Try the new version I released and use the "wayland" feature on bevy_pixels in your own project.

[dependencies]
bevy = { version = "0.6", default_features = false }
bevy_pixels = { version = "0.4", features = ["wayland"] }
adsick commented 2 years ago

using latest bevy with latest bevy_pixels: the same( image

[features]
default = ["wayland"]

# Display server protocol support (X11 is enabled by default)
wayland = ["bevy/wayland"]
x11 = ["bevy/x11"]

[dependencies]
bevy = { path = "../../", version = "0.6", default_features = false, features = ["bevy_winit"] }
pixels = "0.9"

[dev-dependencies]
rand = "0.8"