Closed m-ueberall closed 1 year ago
You're welcome to do so, and we'd probably take a patch to add a flag to build_jni.sh
and the Makefile, but it's not a need Signal has ourselves, so we probably won't publish official artifacts. (I didn't realize there were statically-linked JVMs, either.)
Just found this one via https://github.com/AsamK/signal-cli/discussions/1453 ...
Just tried building with RUSTFLAGS="-C link-arg=-s -C target-feature=-crt-static"
and it at least the buildchain completes....however i have not tested the artifact with musl graalvm native image though.
Running in docker using rust:alpine
apk add build-base ccache clang cmake g++ gcc git protobuf-dev clang-dev
export PATH="/usr/lib/ccache/bin/:$PATH"
export CCACHE_DIR="${CCACHE_DIR:-/tmp/ccache}"
export RUSTC_WRAPPER=/usr/bin/ccache
mkdir -p "$CCACHE_DIR"
export RUSTFLAGS="-C link-arg=-s -C target-feature=-crt-static"
git clone -b v0.40.1 https://github.com/signalapp/libsignal-client /tmp/libsignal-client
cd /tmp/libsignal-client
cargo build --release --verbose -p libsignal-jni
I've attached the final build asset if you want to try.
Hi,
just a heads-up here for the build artefact posted by @morph027. It works as intended on an AMD64/OpenWRT/musl/zulu17.48.15-ca-jre17.0.10-linux_musl_x64/OpenHAB/Signal plugin environment. As the Signal plugin author @dalgwen uses exquo/signal-libs-build I have asked there to include it to the list of platforms @exquo is providing binaries for.
Cheers!
It would be nice to be able to create static binaries of applications that use
libsignal_jni
. For this to work, the library itself needs to be static: