# Build it with Cabal: Mario advises against building with Cabal as managing dependencies and upgrades to them is a pain. But for completeness lets try it. These build steps were extracted from the `distribution/docker/x86_64-musl.dockerfile`. There are already scripts under `distribution/` folder to build for many different platforms. This is probably the easiest way of doing it. But here is a more epxlicit step by step way for a Linux box. Not that compared with the Dockerfile I had to remove static linking, it has `CABALOPTS="-f-export-dynamic -fembed_data_files --enable-executable-static -j4"`. Making a more portable statically linked binary is a bit tricky with Haskell, and that is why the Dockerfile builds on Alpine Linux to do that since it uses musl libc which is a more standalone libc. curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh export PATH="${PATH}:~/.ghcup/bin" ghcup install ghc 9.2.8 --set ghcup install cabal 3.10.1.0 --set cabal update export CABALOPTS="-f-export-dynamic -fembed_data_files -j4" export GHCOPTS="-j4 +RTS -A256m -RTS -split-sections -optc-Os -optl=-pthread" cabal build $CABALOPTS --ghc-options="$GHCOPTS" --only-dependencies cabal build $CABALOPTS --ghc-options="$GHCOPTS"