Rust-rocksdb: RocksDB does not build on musl

Created on 27 Mar 2018  ·  9Comments  ·  Source: rust-rocksdb/rust-rocksdb

It would be nice if rust-rocksdb could build on x86_64-unknown-linux-musl.

I get the following error when using the rust musl docker:

   Compiling librocksdb-sys v5.11.3 (file:///home/rust/src/rust-rocksdb/librocksdb-sys)
error: failed to run custom build command for `librocksdb-sys v5.11.3 (file:///home/rust/src/rust-rocksdb/librocksdb-sys)`
process didn't exit successfully: `/home/rust/src/rust-rocksdb/target/debug/build/librocksdb-sys-030649180e4da4ff/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rerun-if-changed=rocksdb/
cargo:rerun-if-changed=snappy/
rocksdb/include/rocksdb/c.h:48:9: warning: #pragma once in main file [-Wpragma-once-outside-header], err: false
rocksdb/include/rocksdb/c.h:68:10: fatal error: 'stdarg.h' file not found, err: true

--- stderr
rocksdb/include/rocksdb/c.h:48:9: warning: #pragma once in main file [-Wpragma-once-outside-header]
rocksdb/include/rocksdb/c.h:68:10: fatal error: 'stdarg.h' file not found
thread 'main' panicked at 'unable to generate rocksdb bindings: ()', /checkout/src/libcore/result.rs:906:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
enhancement

Most helpful comment

@cetra3 I've solved mine by installing clang, since I was getting an header problem I thought it was a lib package needed, not one with the binaries like clang. Thank you!

All 9 comments

On Fedora28 I got the same error message and just had to install the clang-devel package, which contains the missing stdarg.h (and others...).

Ok with the current master, I can at least compile the thing, but have to make dodgy workarounds as per this issue by adding a musl-g++ symlink to g++ to the PATH.

Steps for posterity:

sudo apt-get install -y clang
sudo ln -s /usr/bin/g++ /usr/bin/musl-g++

I'm not sure why it's looking for musl-g++ ?

@rubencaro Thanks for the tip, had this exact problem even though I had multiple stdarg.h version already.

@cetra3 It's looking for that because of the way cc-rs creates executable names, as noted here, it's "dodgy" https://github.com/alexcrichton/cc-rs/issues/105

I had a look at the cc-rs code but can't really find the spot that it's resolving to musl-g++. I'm hoping that someone smarter than me knows how to adjust it!

I've the same problem on ubuntu 19:04 ubuntu:rolling image, I've installed

build-essential curl llvm-dev libclang-dev linux-headers-generic libsnappy-dev liblz4-dev libzstd-dev libgflags-dev zlib1g-dev libbz2-dev

but I get the same missing stdarg.h error

@cetra3 in the meantime did you find a solution?

Also because compiling rocksdb from their source works fine, from this package doesn't

@alex88 I managed to get it to compile a while ago. See my comment here, this may not be valid anymore

@cetra3 I've solved mine by installing clang, since I was getting an header problem I thought it was a lib package needed, not one with the binaries like clang. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonhoo picture jonhoo  ·  22Comments

elichai picture elichai  ·  6Comments

mvines picture mvines  ·  10Comments

rrichardson picture rrichardson  ·  7Comments

iSynaptic picture iSynaptic  ·  12Comments