build: use statically linked libssl #546
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We build our binaries on ubuntu:20 which uses libssl1.1 (through our direct dependency of
reqwest
). Libssl is dynamically linked and with systems moving to ubuntu:22 that has libssl3.0 our binary breaks. An example is Google's Collab.We also build multiplatform linux docker image using
cross-rs
.cross-rs
currently builds for ubuntu:20 on theirmaster
branch and there is currently an open PR (cross-rs/cross#973) to move to ubuntu:22.The proposed solution with this PR is to enable the feature on
reqwest
that builds the libssl crate (and the libssl library) statically in the sparrow binaries rather than relying on dynamic linking to pick the system's libssl library.We are not moving our CI to use ubuntu:22 until there we have a solution for building multiarch images on ubuntu:22 (through
cross-rs
or otherwise). Otherwise, if we move to ubuntu:22 today with out any other changes our docker image will break on linux on arm (anyone on a Mac with an M chip running a docker container).reqwest
which brings in libssl.if
condition on the release CI that we missedI verified that the binaries
Before:
After
The final
release
binary size increases by 2MBBefore:
After