Build issue on some platforms (Alpine, Arch Linux etc..)
Hello all,
I'm starting to have build issue on some platform. I don't know if it started with 0.3.4 or 0.3.5 but it was OK with 0.3.3.
For instance, on Alpine:
$ cargo build
--- stderr
thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.71.1/lib.rs:604:27:
Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*', 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Repro steps:
- Launch Alpine image
$ docker run -it alpine:latest - Install Rust
$ app add rust cargo - Install libxml libs
$ apk add libxml2-dev - Create a sample
$ cargo init foo && cd foo $ cargo add libxml $ cargo build
With 0.3.3 these steps were OK.
I'm using libxml crate for Hurl, so far I've identified these platforms as KO https://github.com/Orange-OpenSource/hurl/pull/4021/checks
Thanks for this crate BTW
Jc
On Alpine, I've resolved it by adding clang-dev dependencies apk add clang-dev(I supposed needed now by rust-bindgen)
Right, this was somewhat deliberately introduced as a build dependency in #143, as we now run bindgen during build to match the installed libxml2 for the platform.
Maybe we could document it better and/or add a CI target for Arch Linux?
Update with some platform:
- Alpine
$ apk add clang-dev - Ubuntu / Debian
$ apt install libclang-dev - Arch Linux
$ pacman -S clang
I will add Fedora
@dginev I've made a PR with these instructions on the README, fell free to close this issue if you want! => #169
Thanks!