Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build static binaries in CI #874

Closed
1 of 5 tasks
jpraynaud opened this issue Apr 21, 2023 · 1 comment · Fixed by #1043
Closed
1 of 5 tasks

Build static binaries in CI #874

jpraynaud opened this issue Apr 21, 2023 · 1 comment · Fixed by #1043
Assignees
Labels
CI/CD 🏭 CI/CD D-medium Difficulty: medium optimization 🛠️ Optimization and/or small enhancements refactoring 🛠️ Code refactoring and enhancements task

Comments

@jpraynaud
Copy link
Member

jpraynaud commented Apr 21, 2023

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 the cargo 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

  • Setup build phase on Ubuntu 18.04 or 20.04 (means more complex setup of the env, see example with cargo nextest)

Solution 2

@jpraynaud jpraynaud added D-medium Difficulty: medium task refactoring 🛠️ Code refactoring and enhancements delivery-mainnet 🚀 and removed delivery-mainnet 🚀 labels Apr 21, 2023
@jpraynaud jpraynaud added the optimization 🛠️ Optimization and/or small enhancements label Jun 1, 2023
@jpraynaud jpraynaud added the CI/CD 🏭 CI/CD label Jun 12, 2023
@jpraynaud jpraynaud changed the title Build static binaries in CI with nix Build static binaries in CI Jul 10, 2023
@Alenar Alenar self-assigned this Jul 10, 2023
@Alenar
Copy link
Collaborator

Alenar commented Jul 11, 2023

Since it was the easiest solution 1 was used (see #1043), it allow to support systems that bundle glibc 2.31 or more. This include obviously ubuntu version starting 20.04 but also Debian Bullseye (11).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/CD 🏭 CI/CD D-medium Difficulty: medium optimization 🛠️ Optimization and/or small enhancements refactoring 🛠️ Code refactoring and enhancements task
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants