Skip to content

Static binaries for Linux #528

@f-f

Description

@f-f

We should publish statically-linked binaries for our Linux releases. The reason for doing this is that various Linux distros ship different versions of some native libraries we link to, and dynamically linking means that the binary doesn't work out of the box on some of them, and people have to install dependencies with their package manager, etc etc.

It would be nice if we could instead build and publish a statically linked binary. This has been tried in the past (e.g. see #437), but failed because we were still linking to glibc, while to properly link statically we should link to musl.
The easiest way to compile Haskell statically with no hassle is probably with static-haskell-nix.

So to put this into use we should:

  1. add Nix to the Travis CI setup
  2. Nixify the build
  3. Use Nix in CI
  4. make sure that we cache the Nix stuff so CI times don't blow up

This kind of opens up the question of "why use the whole stack thing if we can just build with Nix", which is relevant because I wouldn't want to maintain two build systems that need attention when doing routine things like updating a dependency. So we could figure out a way to reduce this burden - e.g. haskell.nix might help with this?

cc @cdepillabout

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions