bytecodealliance / wamr-rust-sdk

Apache License 2.0
28 stars 8 forks source link

Build Fails on x86_64 from bindgen dependency #43

Open arjunr2 opened 2 months ago

arjunr2 commented 2 months ago

Hi,

The build seems to fail on my machine, particularly due to bindgen dependency (0.69.4) for wamr-sys.

The error seems to be in host pointer sizes on the machine

  thread 'main' panicked at /home/arjun/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.69.4/lib.rs:899:13:
  assertion `left == right` failed: "x86_64-unknown-linux-gnu" "x86_64-unknown-linux-gnu"
    left: 4
   right: 8
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Looks like the pointer size for x86_64 was flagged as 4 bytes, not sure why

AlixANNERAUD commented 1 month ago

It seems that bindgen is unable to use the correct version of clang. In my case, it was the installation of the rust toolchain for the ESP32 (espup) that was causing an issue and was writing the LIBCLANG_PATH environment variable (which is used my libclang-sys). By removing ./export-esp.sh from the .bashrc or unset LIBCLANG_PATH, it works, however, this is not very convenient.