emk / rust-musl-builder

Docker images for compiling static Rust binaries using musl-libc and musl-gcc, with static versions of useful C libraries. Supports openssl and diesel crates.
Apache License 2.0
1.54k stars 193 forks source link

build rocksdb v0.17.0 failed! #137

Open RustChater opened 2 years ago

RustChater commented 2 years ago

Cargo.toml

rocksdb="0.17.0"
...

Build with rust-musl-build:

alias rust-musl-builder='docker run --rm -it -v "$(pwd)":/home/rust/src ekidd/rust-musl-builder'
rust-musl-builder cargo build --release

Got error:

error: failed to run custom build command for `librocksdb-sys v6.20.3`

Caused by:
  process didn't exit successfully: `/home/rust/src/target/release/build/librocksdb-sys-11e46c0a1b4079c0/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at '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: [])"', /home/rust/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/bindgen-0.59.2/src/lib.rs:2144:31
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
JoshuaNitschke commented 2 years ago

@RustChater, install a few more packages:

sudo apt-get update && sudo apt-get install -y libclang-dev clang llvm llvm-dev