hit-on icon indicating copy to clipboard operation
hit-on copied to clipboard

Try producing fully static binaries

Open chshersh opened this issue 5 years ago • 4 comments

Using static-haskell-nix most likely.

chshersh avatar Jan 30 '20 12:01 chshersh

I've run out of space locally when trying to produce a statically linked executable. My work can be found in this branch:

  • https://github.com/kowainik/hit-on/tree/chshersh/138-Try-producing-fully-static-binaries

But in theory, it should work.

chshersh avatar Feb 09 '20 16:02 chshersh

An alternative could be to use Docker and the ghc-musl repository:

  • https://github.com/utdemir/ghc-musl

As a nice bonus point, the repo contains instructions for both cabal and stack and also supports GHC-8.8, so in theory it should be pretty straightforward to use it.

chshersh avatar Feb 10 '20 12:02 chshersh

Okay, Docker works smoothly and without any problems :+1: Looks like it's the way to go. Once we create a release, I will build a statically linked executable and upload it to releases. The only problem now is that the result of the --version command is not nice:

Hit v0.2.0.0
 ➤ Git revision: UNKNOWN
 ➤ Commit date:  UNKNOWN

I believe that this is because the .git folder is not copied. But I hope there's a flag to copy some additional folders, shouldn't be a big problem.

chshersh avatar Feb 10 '20 19:02 chshersh

That is fantastic news! Thanks for working on this. The next release is going to be :fire:

vrom911 avatar Feb 10 '20 19:02 vrom911