Skip to content

Booting HEAD with HEAD fails

I know this is an unsupported configuration but it used to work at some point. Not sure whether this is another Hadrian specific problem.

Situation:

  1. Build a hadrian compiler using quick flavour.
  2. ./configure to use this compiler
  3. Try to perform a build.

I want to do this so that I can run :main from inside GHCi with GHC loaded into it.

  at action, called at src/Rules.hs:76:19 in main:Rules
  at need, called at src/Rules.hs:98:5 in main:Rules
* Depends on: boot-head-ghc/stage0/lib/package.conf.d/ghc-8.9.0.20190611.conf
  at need, called at src/Rules/Register.hs:101:5 in main:Rules.Register
* Depends on: boot-head-ghc/stage0/compiler/build/libHSghc-8.9.0.20190611.a
  at need, called at src/Rules/Library.hs:144:5 in main:Rules.Library
* Depends on: boot-head-ghc/stage0/compiler/build/c/parser/cutils.o
* Raised the exception:
user error (Development.Shake.cmd, system command failed
Command line: /home/matt/ghc/quick-ghci/stage1/bin/ghc -Wall -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-db boot-head-ghc/stage0/lib/package.conf.d' '-this-unit-id ghc-8.9.0.20190611' '-package-id array-0.5.4.0' '-package-id base-4.13.0.0' '-package-id binary-0.8.6.0' '-package-id bytestring-0.10.9.0' '-package-id containers-0.6.0.1' '-package-id deepseq-1.4.4.0' '-package-id directory-1.3.3.2' '-package-id filepath-1.4.2.1' '-package-id ghc-boot-8.9.0.20190611' '-package-id ghc-boot-th-8.9.0.20190611' '-package-id ghc-heap-8.9.0.20190611' '-package-id ghci-8.9.0.20190611' '-package-id hpc-0.6.0.3' '-package-id process-1.6.5.0' '-package-id template-haskell-2.15.0.0' '-package-id terminfo-0.4.1.3' '-package-id time-1.9.2' '-package-id transformers-0.5.6.2' '-package-id unix-2.7.2.2' -i -iboot-head-ghc/stage0/compiler/build -iboot-head-ghc/stage0/compiler/build/autogen -icompiler/backpack -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/hieFile -Iincludes -Iboot-head-ghc/generated -Iboot-head-ghc/stage0/compiler/build -Iboot-head-ghc/stage0/compiler/build/. -Iboot-head-ghc/stage0/compiler/build/parser -Iboot-head-ghc/stage0/compiler/build/utils -Icompiler/. -Icompiler/parser -Icompiler/utils -I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/process-1.6.5.0/include -I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/unix-2.7.2.2/include -I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/time-1.9.2/include -I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/bytestring-0.10.9.0/include -I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/base-4.13.0.0/include -I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/integer-gmp-1.0.2.0/include -I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/rts-1.0/include -Iboot-head-ghc/generated -optc-Iboot-head-ghc/generated -optP-include -optPboot-head-ghc/stage0/compiler/build/autogen/cabal_macros.h -outputdir boot-head-ghc/stage0/compiler/build -optc-Iincludes -optc-Iboot-head-ghc/generated -optc-Iboot-head-ghc/stage0/compiler/build -optc-Iboot-head-ghc/stage0/compiler/build/. -optc-Iboot-head-ghc/stage0/compiler/build/parser -optc-Iboot-head-ghc/stage0/compiler/build/utils -optc-Icompiler/. -optc-Icompiler/parser -optc-Icompiler/utils -optc-I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/process-1.6.5.0/include -optc-I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/unix-2.7.2.2/include -optc-I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/time-1.9.2/include -optc-I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/bytestring-0.10.9.0/include -optc-I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/base-4.13.0.0/include -optc-I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/integer-gmp-1.0.2.0/include -optc-I/home/matt/ghc/quick-ghci/stage1/lib/x86_64-linux-ghc-8.9.0.20190611/rts-1.0/include -optc-fPIC -optc-DDYNAMIC -optc-Werror=unused-but-set-variable -optc-Wno-error=inline -c compiler/parser/cutils.c -o boot-head-ghc/stage0/compiler/build/c/parser/cutils.o -O -H64m -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monoid-instances -this-unit-id ghc -XHaskell2010 -XNoImplicitPrelude -DSTAGE=1 -O2 -fno-warn-deprecated-flags
Exit code: 1
Stderr:
In file included from includes/Rts.h:189:0: error:
    0,
                     from compiler/parser/cutils.c:6:
includes/rts/storage/ClosureMacros.h: In function ‘GET_CLOSURE_TAG’:

includes/rts/storage/ClosureMacros.h:211:25: error:
     error: ‘TAG_MASK’ undeclared (first use in this function); did you mean ‘W_MASK’?
         return (StgWord)p & TAG_MASK;
                             ^~~~~~~~
                             W_MASK
    |
211 |     return (StgWord)p & TAG_MASK;
    |                         ^

includes/rts/storage/ClosureMacros.h:211:25: error:
     note: each undeclared identifier is reported only once for each function it appears in
    |
211 |     return (StgWord)p & TAG_MASK;
    |                         ^
includes/rts/storage/ClosureMacros.h: In function ‘UNTAG_CLOSURE’:

includes/rts/storage/ClosureMacros.h:217:40: error:
     error: ‘TAG_MASK’ undeclared (first use in this function); did you mean ‘W_MASK’?
         return (StgClosure*)((StgWord)p & ~TAG_MASK);
                                            ^~~~~~~~
                                            W_MASK
    |
217 |     return (StgClosure*)((StgWord)p & ~TAG_MASK);
    |                                        ^
includes/rts/storage/ClosureMacros.h: In function ‘UNTAG_CONST_CLOSURE’:

includes/rts/storage/ClosureMacros.h:223:46: error:
     error: ‘TAG_MASK’ undeclared (first use in this function); did you mean ‘W_MASK’?
         return (const StgClosure*)((StgWord)p & ~TAG_MASK);
                                                  ^~~~~~~~
                                                  W_MASK
    |
223 |     return (const StgClosure*)((StgWord)p & ~TAG_MASK);
    |                                              ^
`cc' failed in phase `C Compiler'. (Exit code: 1)
)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information