I’m seeking some advice, as follows. Stack for Linux/x86_64 is statically linked. Historically, it has been produced by building Stack on Alpine Linux/x86_64 with a dependency on musl libc (using Stack, and a Alpine Linux version of GHC (via Nix)) and the Cabal ld-options
: -static
and -pthread
. My problem is this, after GHC 9.2.8, problems with Alpine Linux versions of GHC (official or Nix-supplied) mean they can no longer compile Stack (they segfault at one point or another in the process). Those problems do not look like they will be resolved in the near future.
My question is: is there another way to reach the end objective of a statically linked binary? (I do not have much experience with Linux outside of maintaining CI scripts, or of ‘linking’ - and I don’t really appreciate if there is something ‘special’ about Alpine Linux/musl libc).
EDIT: Or to put the question another way, if I get Stack to build Stack on the GitHub-hosted runner ubuntu-latest
and with the Stack-supplied GHC 9.4.5 (likely, the tinfo6
version) with the same Cabal ld-options
, will the binary that results be - in principle - ‘just as good’ on Linux/x86_64?