gpg-rs / gpgme

GPGme bindings for Rust
GNU Lesser General Public License v2.1
83 stars 13 forks source link

Support for x86_64-unknown-linux-musl #36

Closed timvisee closed 4 years ago

timvisee commented 4 years ago

I'd like to use gpgme in a statically compiled binary with musl.

Sadly, the following compiles but fails with a segfault at runtime when trying to obtain a Context.

export PKG_CONFIG_ALL_STATIC=1
export PKG_CONFIG_ALLOW_CROSS=1
export GPGME_STATIC=1
export LIBGPG_ERROR_STATIC=1

cargo build --target x86_64-unknown-linux-musl --release

Is static compilation with musl supported at all? I couldn't really figure that out based on the README. How would I fix this issue?

timvisee commented 4 years ago

Just came across this Dockerfile, checking that out now: https://github.com/gpg-rs/gpgme/blob/master/docker/Dockerfile.static

timvisee commented 4 years ago

Got it working by manually compiling gpgme dependencies, as shown in the static Dockerfile.

Sorry for not taking a better look first.