Flecs-Rust icon indicating copy to clipboard operation
Flecs-Rust copied to clipboard

Build failed on Darwin 24.2.0 with Xcode 16.2

Open georgik opened this issue 11 months ago • 1 comments

As mentioned in Hyperion repo, it's not possible to build flecs_ecs on Darwin 24.2.0 with Xcode 16.2.

The build fails with:

...
/index.crates.io-1949cf8c6b5b557f/bindgen-0.70.1/lib.rs:892:13:
  assertion `left == right` failed: "arm64-apple-darwin" "aarch64-apple-darwin"
    left: 4
   right: 8
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/a4cb3c831823d9baa56c3d90514b75b2660116fa/library/std/src/panicking.rs:681:5
     1: core::panicking::panic_fmt
               at /rustc/a4cb3c831823d9baa56c3d90514b75b2660116fa/library/core/src/panicking.rs:75:14
     2: core::panicking::assert_failed_inner
     3: core::panicking::assert_failed
               at /rustc/a4cb3c831823d9baa56c3d90514b75b2660116fa/library/core/src/panicking.rs:364:5
     4: bindgen::Bindings::generate
     5: bindgen::Builder::generate
     6: build_script_build::generate_bindings
     7: build_script_build::main
     8: core::ops::function::FnOnce::call_once

It seems that terget architecture is not passed correctly to bindgen.

It seems that solution might be similar to spdm-utils, just adding the following line to flecs_ecs_sys/build.rs:

.clang_arg(format!("--target={}", env::var("HOST").unwrap()))

After this correction it was possible to build the project and it generated just following warning:

warning: unused variable: `world_ptr`
   --> flecs_ecs/src/core/query_tuple.rs:328:13
    |
328 |         let world_ptr = query.world_ptr();
    |             ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_world_ptr`
    |
    = note: `#[warn(unused_variables)]` on by default

Please, consider implementing a correction.

georgik avatar Jan 05 '25 18:01 georgik

made https://github.com/Indra-db/Flecs-Rust/pull/219

I am unsure if this works, however.

andrewgazelka avatar Jan 05 '25 19:01 andrewgazelka

closing this. You guys aren't using this anymore and I believe it could be already solved.

Indra-db avatar Nov 03 '25 10:11 Indra-db