Closed stephanbuys closed 4 years ago
I suspect that the problem is that you installed RocksDB in the Debian build environment, which uses glibc, and not in the musl-libc cross-compilation environment. See here:
RUN apt-get install -y build-essential curl llvm-dev libclang-dev linux-headers-generic libsnappy-dev liblz4-dev libzstd-dev libgflags-dev zlib1g-dev libbz2-dev
# RUN apt-get install -y librocksdb-dev
You need to manually download all the different C/C++ libraries, and build them using the cross-compilation toolchain. Here's an example to get you started. However, this process is subject to much trial and error, and I generally don't have enough free time these days to figure out all the tricks for a library I don't use. RocksDB seems to have a pretty long list of native dependencies, and you may need to submit upstream patches for some of them to support cross-compilation.
Good luck, and I'm sorry I can't help you more with this.
Hi @emk,
I'm trying to get a project using the rocksdb crate to compile using your image, but I'm pretty stuck and thus reaching out for help.
A minimal project would look something like this (lifter out of the
rocksdb
docs):Cargo.toml should contain:
main.rs:
Tried to compile this using:
What happened?
What did you hope to happen?
Compile binary using the
x86_64-unknown-linux-musl
target.Additional information
I added dependencies to the container as such but am still stuck:
Dockerfile:
Any help/pointers would be greatly appreciated.