makspll / bevy_mod_scripting

Bevy Scripting Plugin
Apache License 2.0
391 stars 30 forks source link

Examples don't compile anymore due to conflicting deps? #36

Closed darthdeus closed 1 year ago

darthdeus commented 1 year ago

I'm not sure if this is a problem on my side, though the examples I've tried all seem to fail because two versions of nix are in use, e.g. when I run this on main

cargo run --example complex_game_loop_lua --features lua54

I get the following error

$ cargo run --example complex_game_loop_lua --features lua54                main@781754a
   Compiling syn v1.0.103
   Compiling serde v1.0.147
   Compiling rand_chacha v0.3.1
   Compiling rand v0.8.5
   Compiling encase_derive_impl v0.3.0
   Compiling toml v0.5.9
   Compiling bevy_macro_utils v0.8.1
   Compiling serde_derive v1.0.147
   Compiling thiserror-impl v1.0.37
   Compiling bytemuck_derive v1.2.1
   Compiling bevy_reflect_derive v0.8.1
   Compiling bevy_ecs_macros v0.8.1
   Compiling bevy_derive v0.8.1
   Compiling encase_derive v0.3.0
   Compiling bevy_encase_derive v0.8.1
   Compiling bevy_render_macros v0.8.1
   Compiling gltf-derive v1.0.0
   Compiling hash32-derive v0.1.1
   Compiling tealr_derive v0.9.0-alpha3
   Compiling taffy v0.1.0
   Compiling bytemuck v1.12.1
   Compiling image v0.24.4
   Compiling thiserror v1.0.37
   Compiling smallvec v1.10.0
   Compiling hashbrown v0.12.3
   Compiling glam v0.21.3
   Compiling uuid v1.2.1
   Compiling erased-serde v0.3.23
   Compiling serde_json v1.0.87
   Compiling ron v0.7.1
   Compiling tealr v0.9.0-alpha3
   Compiling parking_lot_core v0.9.4
   Compiling tracing-subscriber v0.3.16
   Compiling parking_lot_core v0.8.5
   Compiling parking_lot v0.12.1
   Compiling parking_lot v0.11.2
   Compiling gilrs-core v0.4.1
   Compiling bevy_utils v0.8.1
   Compiling indexmap v1.9.1
   Compiling gpu-descriptor v0.2.3
   Compiling cpal v0.13.5
   Compiling winit v0.26.1
   Compiling gilrs v0.9.0
error[E0308]: mismatched types
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/cpal-0.13.5/src/host/alsa/mod.rs:245:21
    |
244 |         let handle = match handle_result {
    |                            ------------- this expression has type `std::result::Result<host::alsa::alsa::PCM, (host::alsa::alsa::Error, host::alsa::alsa::nix::errno::Errno)>`
245 |             Err((_, nix::errno::Errno::EBUSY)) => return Err(BuildStreamError::DeviceNotAvailable),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `host::alsa::alsa::nix::errno::Errno`, found enum `nix::errno::Errno`
    |
    = note: enum `nix::errno::Errno` and enum `host::alsa::alsa::nix::errno::Errno` have similar names, but are actually distinct types
note: enum `nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.23.1/src/errno.rs:774:5
    |
774 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
note: enum `host::alsa::alsa::nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.24.2/src/errno.rs:776:5
    |
776 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `nix` are being used?

error[E0308]: mismatched types
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/cpal-0.13.5/src/host/alsa/mod.rs:246:21
    |
244 |         let handle = match handle_result {
    |                            ------------- this expression has type `std::result::Result<host::alsa::alsa::PCM, (host::alsa::alsa::Error, host::alsa::alsa::nix::errno::Errno)>`
245 |             Err((_, nix::errno::Errno::EBUSY)) => return Err(BuildStreamError::DeviceNotAvailable),
246 |             Err((_, nix::errno::Errno::EINVAL)) => return Err(BuildStreamError::InvalidArgument),
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `host::alsa::alsa::nix::errno::Errno`, found enum `nix::errno::Errno`
    |
    = note: enum `nix::errno::Errno` and enum `host::alsa::alsa::nix::errno::Errno` have similar names, but are actually distinct types
note: enum `nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.23.1/src/errno.rs:774:5
    |
774 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
note: enum `host::alsa::alsa::nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.24.2/src/errno.rs:776:5
    |
776 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `nix` are being used?

error[E0308]: mismatched types
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/cpal-0.13.5/src/host/alsa/mod.rs:302:21
    |
301 |         let handle = match handle_result {
    |                            ------------- this expression has type `std::result::Result<&mut host::alsa::alsa::PCM, (host::alsa::alsa::Error, host::alsa::alsa::nix::errno::Errno)>`
302 |             Err((_, nix::errno::Errno::ENOENT)) | Err((_, nix::errno::Errno::EBUSY)) => {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `host::alsa::alsa::nix::errno::Errno`, found enum `nix::errno::Errno`
    |
    = note: enum `nix::errno::Errno` and enum `host::alsa::alsa::nix::errno::Errno` have similar names, but are actually distinct types
note: enum `nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.23.1/src/errno.rs:774:5
    |
774 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
note: enum `host::alsa::alsa::nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.24.2/src/errno.rs:776:5
    |
776 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `nix` are being used?

error[E0308]: mismatched types
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/cpal-0.13.5/src/host/alsa/mod.rs:302:59
    |
301 |         let handle = match handle_result {
    |                            ------------- this expression has type `std::result::Result<&mut host::alsa::alsa::PCM, (host::alsa::alsa::Error, host::alsa::alsa::nix::errno::Errno)>`
302 |             Err((_, nix::errno::Errno::ENOENT)) | Err((_, nix::errno::Errno::EBUSY)) => {
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `host::alsa::alsa::nix::errno::Errno`, found enum `nix::errno::Errno`
    |
    = note: enum `nix::errno::Errno` and enum `host::alsa::alsa::nix::errno::Errno` have similar names, but are actually distinct types
note: enum `nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.23.1/src/errno.rs:774:5
    |
774 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
note: enum `host::alsa::alsa::nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.24.2/src/errno.rs:776:5
    |
776 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `nix` are being used?

error[E0308]: mismatched types
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/cpal-0.13.5/src/host/alsa/mod.rs:305:21
    |
301 |         let handle = match handle_result {
    |                            ------------- this expression has type `std::result::Result<&mut host::alsa::alsa::PCM, (host::alsa::alsa::Error, host::alsa::alsa::nix::errno::Errno)>`
...
305 |             Err((_, nix::errno::Errno::EINVAL)) => {
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `host::alsa::alsa::nix::errno::Errno`, found enum `nix::errno::Errno`
    |
    = note: enum `nix::errno::Errno` and enum `host::alsa::alsa::nix::errno::Errno` have similar names, but are actually distinct types
note: enum `nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.23.1/src/errno.rs:774:5
    |
774 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
note: enum `host::alsa::alsa::nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.24.2/src/errno.rs:776:5
    |
776 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `nix` are being used?

error[E0308]: mismatched types
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/cpal-0.13.5/src/host/alsa/mod.rs:720:36
    |
720 |         Err(err) if err.errno() == nix::errno::Errno::EPIPE => {
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `host::alsa::alsa::nix::errno::Errno`, found enum `nix::errno::Errno`
    |
    = note: enum `nix::errno::Errno` and enum `host::alsa::alsa::nix::errno::Errno` have similar names, but are actually distinct types
note: enum `nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.23.1/src/errno.rs:774:5
    |
774 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
note: enum `host::alsa::alsa::nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.24.2/src/errno.rs:776:5
    |
776 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `nix` are being used?

error[E0308]: mismatched types
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/cpal-0.13.5/src/host/alsa/mod.rs:803:40
    |
803 |             Err(err) if err.errno() == nix::errno::Errno::EPIPE => {
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `host::alsa::alsa::nix::errno::Errno`, found enum `nix::errno::Errno`
    |
    = note: enum `nix::errno::Errno` and enum `host::alsa::alsa::nix::errno::Errno` have similar names, but are actually distinct types
note: enum `nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.23.1/src/errno.rs:774:5
    |
774 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
note: enum `host::alsa::alsa::nix::errno::Errno` is defined in crate `nix`
   --> /home/darth/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.24.2/src/errno.rs:776:5
    |
776 |     pub enum Errno {
    |     ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `nix` are being used?

For more information about this error, try `rustc --explain E0308`.
error: could not compile `cpal` due to 7 previous errors
makspll commented 1 year ago

Hi there! thanks for using bevy_mod_scripting!

I've had a quick look, this is a weird error, it appears that this might be coming from upstream in Bevy:

Could you try the recommended temporary fix?: https://github.com/diwic/alsa-rs/issues/90#issuecomment-1288134557

est31 commented 1 year ago

Oh no it's also affecting the cpal 0.13 branch... have to file a fix for that too...

makspll commented 1 year ago

I am assuming this was the issue, please re-open if this didn't solve your problem