redisearch-api-rs icon indicating copy to clipboard operation
redisearch-api-rs copied to clipboard

Unable to build on ARM macos

Open strowbeary opened this issue 3 years ago • 5 comments

Hello i'm unable to build this module on macos arm 64 Here are the logs

Compiling redis-module v0.11.0
   Compiling redisearch_api v0.5.0 (/Users/r.caillot/Projets/mfo/devconfig/redisearch-api-rs)
error: failed to run custom build command for `redisearch_api v0.5.0 (/Users/r.caillot/Projets/mfo/devconfig/redisearch-api-rs)`

Caused by:
  process didn't exit successfully: `/Users/r.caillot/Projets/mfo/devconfig/redisearch-api-rs/target/release/build/redisearch_api-443e9160d87e8a14/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'libclang error; possible causes include:
  - Invalid flag syntax
  - Unrecognized flags
  - Invalid flag arguments
  - File I/O errors
  - Host vs. target architecture mismatch
  If you encounter an error missing from this list, please file an issue or a PR!', /Users/r.caillot/.cargo/registry/src/github.com-1ecc6299db9ec823/bindgen-0.54.0/src/ir/context.rs:573:15
  stack backtrace:
     0:        0x100d787f8 - std::backtrace_rs::backtrace::libunwind::trace::hfb13038f037c000a
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
     1:        0x100d787f8 - std::backtrace_rs::backtrace::trace_unsynchronized::hfd5696347470fa7d
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
     2:        0x100d787f8 - std::sys_common::backtrace::_print_fmt::hdf1e7b50816ccd2b
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/sys_common/backtrace.rs:67:5
     3:        0x100d787f8 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h043213eec1d948a5
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/sys_common/backtrace.rs:46:22
     4:        0x100d95524 - core::fmt::write::hf53968076cf4f14e
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/core/src/fmt/mod.rs:1096:17
     5:        0x100d74d94 - std::io::Write::write_fmt::h28b0246eee567fa4
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/io/mod.rs:1568:15
     6:        0x100d7ae64 - std::sys_common::backtrace::_print::h7a62d6bcf54b6634
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/sys_common/backtrace.rs:49:5
     7:        0x100d7ae64 - std::sys_common::backtrace::print::hb53039f14ad1e4cc
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/sys_common/backtrace.rs:36:9
     8:        0x100d7ae64 - std::panicking::default_hook::{{closure}}::h8d1966a8d6a15176
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/panicking.rs:208:50
     9:        0x100d7a98c - std::panicking::default_hook::h9e61206a690d3893
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/panicking.rs:225:9
    10:        0x100d7b418 - std::panicking::rust_panic_with_hook::hd1308496ca12fe75
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/panicking.rs:591:17
    11:        0x100d7aff4 - std::panicking::begin_panic_handler::{{closure}}::h8b5bd5b2a5ff6ad8
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/panicking.rs:497:13
    12:        0x100d78c90 - std::sys_common::backtrace::__rust_end_short_backtrace::hd5101d74264c890c
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/sys_common/backtrace.rs:141:18
    13:        0x100d7af5c - rust_begin_unwind
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/panicking.rs:493:5
    14:        0x100d9fa14 - core::panicking::panic_fmt::hbf2ae8920d2f2a82
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/core/src/panicking.rs:92:14
    15:        0x100d9f914 - core::option::expect_failed::h22a294dd1d9df2f3
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/core/src/option.rs:1292:5
    16:        0x100ab515c - core::option::Option<T>::expect::ha8a3605289a5f3ee
    17:        0x1009d6338 - bindgen::ir::context::BindgenContext::new::h7304902c3739e131
    18:        0x100ad3ec0 - bindgen::Bindings::generate::h337c7234f19898ed
    19:        0x100ad2050 - bindgen::Builder::generate::h7c3a87afe4f7eed6
    20:        0x100925a04 - build_script_build::main::h91a2f516426c20e4
    21:        0x10092517c - core::ops::function::FnOnce::call_once::hff9a3a7eddd5cd82
    22:        0x100925628 - std::sys_common::backtrace::__rust_begin_short_backtrace::hcc6510ba28e164b1
    23:        0x1009250d8 - std::rt::lang_start::{{closure}}::h4b0f27a2b577c1e9
    24:        0x100d7b860 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::hf5ddf54157e6c726
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/core/src/ops/function.rs:259:13
    25:        0x100d7b860 - std::panicking::try::do_call::h44e5ecc5a9e8a72f
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/panicking.rs:379:40
    26:        0x100d7b860 - std::panicking::try::h75f955d26adda2e7
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/panicking.rs:343:19
    27:        0x100d7b860 - std::panic::catch_unwind::h118d1549ab28cd4f
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/panic.rs:431:14
    28:        0x100d7b860 - std::rt::lang_start_internal::h11dfd92f6b2513dc
                                 at /rustc/d1206f950ffb76c76e1b74a19ae33c2b7d949454/library/std/src/rt.rs:51:25
    29:        0x1009250b4 - std::rt::lang_start::hc412d9586106f805
    30:        0x100925e00 - _main
warning: build failed, waiting for other jobs to finish...
error: build failed

strowbeary avatar Feb 17 '21 16:02 strowbeary

@strowbeary thanks for reporting this issue, sorry but I don't have access to MacOS with M1, it seems like a bug in bindgen. Can you please try to rebuild with bindgen = "0.57.0"?

gkorland avatar Feb 18 '21 12:02 gkorland

It gives me

error: failed to select a version for `clang-sys`.
    ... required by package `bindgen v0.57.0`
    ... which is depended on by `redisearch_api v0.5.0 (/Users/r.caillot/Projets/mfo/redisearch-api-rs)`
versions that meet the requirements `^1` are: 1.1.0, 1.0.3, 1.0.2, 1.0.1, 1.0.0

the package `clang-sys` links to the native library `clang`, but it conflicts with a previous package which links to `clang` as well:
package `clang-sys v0.29.0`
    ... which is depended on by `bindgen v0.54.0`
    ... which is depended on by `redis-module v0.11.0`
    ... which is depended on by `redisearch_api v0.5.0 (/Users/r.caillot/Projets/mfo/redisearch-api-rs)`

failed to select a version for `clang-sys` which could resolve this conflict

I'll try to update all dependencies to make it work later

strowbeary avatar Feb 18 '21 13:02 strowbeary

No idea why @strowbeary has still problems, but it works for me.

npajkovsky avatar Feb 18 '21 18:02 npajkovsky

cargo update -p bindgen

fundon avatar Feb 19 '21 05:02 fundon

The problem is, that this patch adds bindgen 0.57.0 however, rust-modules have 0.57.

npajkovsky avatar Feb 19 '21 08:02 npajkovsky