crate-ci / meta

For discussing and proposing ways to improve the Rust CI ecosystem.
8 stars 0 forks source link

Build truly static binaries #20

Closed vbrandl closed 6 years ago

vbrandl commented 6 years ago

Linking Linux binaries against the glibc targets i686-unknown-linux-gnu and x86_64-unknown-linux-gnu will not produce static binaries since it dynamically links against the systems glibc and possibly others (e.g. OpenSSL). Since binaries produced in CI should work without depending of specific versions of libraries being installed in the users system, I think it is better to link the released binaries against the musl targets (i686-unknown-linux-musl and x86_64-unknown-linux-musl). While you might have to use helper crates like openssl-probe to make some things work, I prefer truly portable binaries over the alternative. To link against musl in CI, I use the ekidd/rust-musl-builder image in my CI setup.

Edit: I didn't catch #11 before...

epage commented 6 years ago

Went ahead and merged this into #11. Thanks for all of the additional information!