Here is my build.mk:
################## BUILD.MK
# Default to a very fast build for compilation and stage1:
SRC_HC_OPTS = -H64m -O0
GhcStage1HcOpts = -O -fasm
# But then use perf-llvm settings for remaining settings:
GhcStage2HcOpts = -O2 -fllvm
GhcHcOpts = -Rghc-timing
GhcLibHcOpts = -O2 -fllvm -XGenerics
GhcLibWays += p
DYNAMIC_BY_DEFAULT = NO
DYNAMIC_GHC_PROGRAMS = NO
# Disable building all docs
HADDOCK_DOCS = NO
BUILD_DOCBOOK_HTML = NO
BUILD_DOCBOOK_PS = NO
BUILD_DOCBOOK_PDF = NO
################## BUILD.MK
Second issue: These seem to bring memory usage down, but the monolithic “.\make” command is difficult to debug and very time consuming. When building a container image from a Dockerfile, the commands used are cached so that subsequent attempted builds
use the intermediate results. So, even though my Dockerfile starts out with “apt-get update; apt-get upgrade -y”, I don’t have to do that every time I retry my build.
Currently my Dockerfile pulls all the requisite packages from Ubuntu’s repos, downloads and builds the latest cabal-install and builds alex, happy, hscolour and haddock, gets the ghc repo from GitHub, does “perl boot” “.\configure” and then I hit a wall
with the monstrous amount of work that “.\make” does. I have tried splitting it up by doing “.\make stage=1”, “.\make 1”, and various combinations, but I hit dependency issues. Is there a way to break up the build into multiple commands?