bevy_mod_scripting: Incompatible types when compiling on Arm64

I am facing a similar set of errors to #61 with bevy 0.11.2 and bevy_mod_scripting commit 8bf3796 with the lua_script_api flag enabled

cargo run
    Updating git repository `https://github.com/makspll/bevy_mod_scripting`
   Compiling bevy_script_api v0.3.0 (https://github.com/makspll/bevy_mod_scripting?rev=8bf3796#8bf37962)
error[E0599]: no variant or associated item named `Pairs` found for enum `LuaMetaMethod` in the current scope
   --> /Users/videah/.cargo/git/checkouts/bevy_mod_scripting-66f82db9d3a19d6f/8bf3796/bevy_script_api/src/lua/std.rs:317:45
    |
317 |         methods.add_meta_method(MetaMethod::Pairs, |ctx, s, _: ()| {
    |                                             ^^^^^ variant or associated item not found in `LuaMetaMethod`

error[E0308]: `?` operator has incompatible types
    --> /Users/videah/.cargo/git/checkouts/bevy_mod_scripting-66f82db9d3a19d6f/8bf3796/bevy_script_api/src/generated.rs:4501:17
     |
4501 |     #[languages(on_feature(lua))]
     |                 ^^^^^^^^^^^^^^^ expected `BVec4`, found `BVec4A`
     |
     = note: `?` operator cannot convert from `BVec4A` to `BVec4`
     = note: this error originates in the macro `impl_lua_newtype` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0308]: mismatched types
    --> /Users/videah/.cargo/git/checkouts/bevy_mod_scripting-66f82db9d3a19d6f/8bf3796/bevy_script_api/src/generated.rs:4501:17
     |
4501 |     #[languages(on_feature(lua))]
     |                 ^^^^^^^^^^^^^^^
     |                 |
     |                 expected `BVec4A`, found `BVec4`
     |                 arguments to this function are incorrect
     |
note: associated function defined here
    --> /Users/videah/.cargo/git/checkouts/bevy_mod_scripting-66f82db9d3a19d6f/8bf3796/bevy_script_api/src/wrappers.rs:38:16
     |
38   |         pub fn new(b: $type_) -> Self {
     |                ^^^ ---------
     |
    ::: /Users/videah/.cargo/git/checkouts/bevy_mod_scripting-66f82db9d3a19d6f/8bf3796/bevy_script_api/src/generated.rs:5050:17
     |
5050 |     #[languages(on_feature(lua))]
     |                 --------------- in this macro invocation
     = note: this error originates in the macro `impl_lua_newtype` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0308, E0599.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `bevy_script_api` (lib) due to 3 previous errors

My Cargo.toml looks like this:

[package]
name = "myrrh"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

# Enable a small amount of optimization in debug mode
[profile.dev]
opt-level = 1

# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
[profile.dev.package."*"]
opt-level = 3

[dependencies]
bevy = { version = "0.11.2", features = ["dynamic_linking"] }
bevy_mod_scripting = { git = "https://github.com/makspll/bevy_mod_scripting", rev = "8bf3796", version = "0.3.0", features = ["luajit", "teal", "lua_script_api"] }

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 18 (12 by maintainers)

Most upvoted comments

I’m running into the same issue:

error[E0308]: `?` operator has incompatible types
    --> /Users/andrew/.cargo/git/checkouts/bevy_mod_scripting-66f82db9d3a19d6f/7590248/bevy_script_api/src/generated.rs:4518:9
     |
4518 |         ///Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `BVec4`, found `BVec4A`
     |
     = note: `?` operator cannot convert from `BVec4A` to `BVec4`

This happens with both the lua54 and luajit features.

Cargo.toml:

[package]
name = "bevyworld"
version = "0.1.0"
edition = "2021"

[dependencies]
bevy_mod_scripting = { git = "https://github.com/makspll/bevy_mod_scripting.git", rev = "7590248", features = ["luajit","lua_script_api"] }
bevy_mod_scripting_lua = { git = "https://github.com/makspll/bevy_mod_scripting.git", rev = "7590248"}
bevy = { version = "0.11.2", features = ["dynamic_linking", "serialize","bevy_asset","bevy_core_pipeline","bevy_pbr","bevy_render","bevy_sprite","bevy_winit","filesystem_watcher","hdr","multi-threaded","tonemapping_luts","ktx2","zstd"] , default-features = false }
rand = "0.8.5"
rand_distr = "0.4.3"

I get this error on both a new project and when running several of the example projects. Is there a solution?

Thanks!

That’s now merged into main, and luajit should work with the lua script api feature