Build static binaries in CI #874
Labels
CI/CD 🏭
CI/CD
D-medium
Difficulty: medium
optimization 🛠️
Optimization and/or small enhancements
refactoring 🛠️
Code refactoring and enhancements
task
Issue
We want to build binaries that are compatible with most Linux systems and avoid conflicts with glibc version
Solution 1: Ubuntu 18.04 or 20.04
Building on an older system version means using an older version of the glibc library, which means avoiding the versions conflict we usually face
Solution 2: Nix build
The
nix build
commands have been merged in PR #811. These commands build static binaries whereas thecargo build
commands build dynamic binaries. We have encountered difficulties with the dynamic binaries produced by the CI due to compatibility versions on some of the libraries dynamically linked as described in issue #834.We need to test in a Poc if the nix commands can be used in replacement on the build jobs of the workflows (if it works and how long it takes vs current workflows)
Solution 3: MUSL build
We could use MUSL to build the binaries, but it will bring other problems due to cross compilation (openssl, sqlite compilations fialing). We decide to not investigate that option at the moment.
To do
Solution 1
Solution 2
Build binaries withnix
instead ofcargo
Verify build times are acceptable from CI perspectiveVerify that there is no issue regarding evolution (e.g. new cargo versions, ...)Verify static builds and that it fixes issue Debian package does not install cleanly on older ubuntu versions #834The text was updated successfully, but these errors were encountered: