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

nix: static builds and release workflow #1133

Merged
merged 8 commits into from
Nov 28, 2023
Merged

nix: static builds and release workflow #1133

merged 8 commits into from
Nov 28, 2023

Conversation

elopez
Copy link
Member

@elopez elopez commented Oct 26, 2023

This PR implements (partially) static builds for Echidna using Nix, similarly to how it's implemented in hevm. The Linux build in particular uses musl, to avoid the problems that glibc has with static binaries and multithreading.

It also replaces our current Nix workflow with a new one that builds regular echidna, as well as this new redistributable/static build on the three platforms we can run Nix on Actions:

  • linux x86_64
  • macOS x86_64
  • macOS aarch64

These binaries are then signed (with sigstore) and uploaded to a draft release in case the workflow was triggered by a Git tag, easing our release preparation. If the workflow was triggered by something else (branch, PR), the redistributable executables are available as a workflow artifact.

TODO (help wanted!)

  • See if we can select musl just for echidna-redistributable; rebuilding everything with musl is not quick and it does not seem to be cached by nixos (~2h cold cache build on GH actions).
    • Added Cachix to the workflow, so this should not be an issue

Future work

  • Consider adding a Windows build to the release workflow.

Adds a "redistributable" flavor of Echidna that is fully static on
Linux, and mostly static on macOS.
Replaces previous Nix workflow
ncurses in Nix is built with a TERMINFO path that references `/nix`.
This causes the binaries fail when ran on non-nix systems, unless
TERMINFO=/usr/share/terminfo is exported. This patches the binaries
to use a more sensible default TERMINFO path.

See also commit f76a7f4
@elopez elopez force-pushed the dev-semi-static-macos branch from 8e568bf to 77d75eb Compare October 31, 2023 16:43
@elopez elopez marked this pull request as ready for review October 31, 2023 17:32
Copy link
Member

@arcz arcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing!

@arcz arcz merged commit 494eb92 into master Nov 28, 2023
18 checks passed
@arcz arcz deleted the dev-semi-static-macos branch November 28, 2023 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants