Skip to content

GHC 9.2.2 can't bootstrap itself with the make build system

Strangely, GHC appears to be unable to bootstrap itself from %9.2.2 when using the make build system. This was reported last week by Eric Lindblad and we recently encountered this issue in !7867 (closed) as well.

In short, the build fails very early in the stage1 build as the build output directory does not exist. For instance,

"/opt/ghc/9.2.2/bin/ghc" -hisuf hi -osuf  o -hcsuf hc -static  -O0 -H64m -Wall   -package-db libraries/bootstrapping.conf  -this-unit-id template-haskell-2.18.0.0 -hide-all-packages -package-env - -i -ilibraries/template-haskell/. -ilibraries/template-haskell/dist-boot/build -Ilibraries/template-haskell/dist-boot/build -ilibraries/template-haskell/dist-boot/build/./autogen -Ilibraries/template-haskell/dist-boot/build/./autogen -Ilibraries/template-haskell/.  -optP-include -optPlibraries/template-haskell/dist-boot/build/./autogen/cabal_macros.h -package-id base-4.16.1.0 -package-id filepath-1.4.2.2 -package-id ghc-boot-th-9.3 -package-id ghc-prim-0.8.0 -package-id pretty-1.1.3.6 -Wall -this-unit-id template-haskell -XHaskell2010 -XNoImplicitPrelude   -no-user-package-db -rtsopts  -fno-warn-deprecated-flags      -outputdir libraries/template-haskell/dist-boot/build   -c libraries/template-haskell/./Language/Haskell/TH/PprLib.hs -o libraries/template-haskell/dist-boot/build/Language/Haskell/TH/PprLib.o 
<command line>: error: directory portion of "libraries/template-haskell/dist-boot/build/Language/Haskell/TH.o" does not exist (used with "-o" option.)
<command line>: error: directory portion of "libraries/template-haskell/dist-boot/build/Language/Haskell/TH/Lib.o" does not exist (used with "-o" option.)
<command line>: error: directory portion of "libraries/template-haskell/dist-boot/build/Language/Haskell/TH/Ppr.o" does not exist (used with "-o" option.)
compiler/ghc.mk:241: compiler/stage1/build/.depend-v.haskell: No such file or directory
make[1]: *** [libraries/template-haskell/ghc.mk:3: libraries/template-haskell/dist-boot/build/Language/Haskell/TH.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [libraries/template-haskell/ghc.mk:3: libraries/template-haskell/dist-boot/build/Language/Haskell/TH/Lib.o] Error 1
make[1]: *** [libraries/template-haskell/ghc.mk:3: libraries/template-haskell/dist-boot/build/Language/Haskell/TH/Ppr.o] Error 1
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information