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

libraries w/ c dependecies don't compile inside musl builder #52

Closed Licenser closed 6 years ago

Licenser commented 6 years ago

I'm not sure where to exactly open this so I'll link it here too: https://github.com/fede1024/rust-rdkafka/issues/88

emk commented 6 years ago

Unfortunately, you'll need to compile the C libraries you need using musl-gcc, being careful to set up all the necessary flags. You may also need to tweak the Rust crate in some cases. There's no way to automate this; statically building C libraries will require getting your hands dirty.

See https://github.com/emk/rust-musl-builder#adding-more-c-libraries for some notes and for an example of how to add a new C library.