ghctags being gone, I don't have any problem getting the build to complete with this very simple patch:
diff --git a/hadrian/src/UserSettings.hs b/hadrian/src/UserSettings.hsindex c92dd11d44..b6fc30bd90 100644--- a/hadrian/src/UserSettings.hs+++ b/hadrian/src/UserSettings.hs@@ -59,4 +59,4 @@ successColour = mkSuccessColour (Dull Green) -- 'Stage1' compiler. Setting it to 'Stage3' will build the 'Stage3' -- compiler. Setting it to 'Stage0' will mean nothing gets built at all. finalStage :: Stage-finalStage = Stage2+finalStage = Stage1
(this is a setting Matthew introduced somewhat recently, documented in hadrian's docs)
With this in place, a simple hadrian/build.sh -j4 builds stage 1 to completion. However, trying to build this trivial Haskell program then fails:
main=putStrLn"hello"
with
$ _build/stage0/bin/aarch64-unknown-linux-gnu-ghc hello.hs -o hello[1 of 1] Compiling Main ( hello.hs, hello.o )hello.hs:1:1: error: Bad interface file: /nix/store/8h3fdgpq66w8kxzxn49s706505a7ihnr-ghc-8.4.3/lib/ghc-8.4.3/base-4.11.1.0/Prelude.hi mismatched interface file versions (wanted "80720190211", got "8043") |1 | main = putStrLn "hello" | ^
The cross-compiler ends up looking at the boot compiler's interface files instead of its own.
> ./boot> (cd hadrian; stack exec --cwd .. -- ./configure --target=aarch64-linux-gnu)...----------------------------------------------------------------------Configure completed successfully. Building GHC version : 8.11.0.20200309 Git commit id : 86d47d6f655e5906a932bb8d583d3590ce5c5fc1 Build platform : x86_64-unknown-linux Host platform : x86_64-unknown-linux Target platform : aarch64-unknown-linux Bootstrapping using : /home/hsyl20/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/bin/ghc which is version : 8.6.5 Using (for bootstrapping) : gcc Using gcc : aarch64-linux-gnu-gcc which is version : 9.2.0 linker options : -fuse-ld=gold Building a cross compiler : YES Unregisterised : NO TablesNextToCode : YES Build GMP in tree : NO hs-cpp : aarch64-linux-gnu-gcc hs-cpp-flags : -E -undef -traditional ar : aarch64-linux-gnu-ar ld : aarch64-linux-gnu-ld.gold nm : aarch64-linux-gnu-nm libtool : objdump : aarch64-linux-gnu-objdump ranlib : aarch64-linux-gnu-ranlib windres : dllwrap : genlib : Happy : /home/hsyl20/.stack/snapshots/x86_64-linux-tinfo6/2395421d34b6f6f91c3704723a01d71ff08b9a07839879c30cb032c622896962/8.6.5/bin/happy (1.19.12) Alex : /home/hsyl20/.stack/snapshots/x86_64-linux-tinfo6/2395421d34b6f6f91c3704723a01d71ff08b9a07839879c30cb032c622896962/8.6.5/bin/alex (3.2.4) sphinx-build : /usr/bin/sphinx-build xelatex : /usr/bin/xelatex makeinfo : /usr/bin/makeinfo Using LLVM tools clang : llc : llc opt : opt HsColour was not found; documentation will not contain source links Tools to build Sphinx HTML documentation available: YES Tools to build Sphinx PDF documentation available: YES Tools to build Sphinx INFO documentation available: YES----------------------------------------------------------------------> ./hadrian/build-stack --flavour=quick...Error when running Shake build system: at action, called at src/Rules.hs:71:19 in main:Rules at need, called at src/Rules.hs:93:5 in main:Rules* Depends on: _build/stage1/bin/aarch64-linux-gnu-hp2ps at need, called at src/Hadrian/Utilities.hs:319:5 in main:Hadrian.Utilities* Depends on: _build/stage0/bin/aarch64-linux-gnu-hp2ps at error, called at src/Rules/Program.hs:42:29 in main:Rules.Program* Raised the exception:Unknown program "_build/stage0/bin/aarch64-linux-gnu-hp2ps"> ./hadrian/build-stack --flavour=quick stage1:exe:ghc-bin...Error when running Shake build system: at want, called at src/Main.hs:89:30 in main:Main* Depends on: stage1:exe:ghc-bin at need, called at src/Rules/SimpleTargets.hs:35:5 in main:Rules.SimpleTargets* Depends on: _build/stage0/bin/aarch64-linux-gnu-ghc at need, called at src/Rules/Register.hs:78:5 in main:Rules.Register* Depends on: _build/stage0/lib/x86_64-linux-ghc-8.6.5/ghc-8.11.0.20200309/libHSghc-8.11.0.20200309.a at need, called at src/Rules/Library.hs:44:5 in main:Rules.Library* Depends on: _build/stage0/lib/package.conf.d/ghc-8.11.0.20200309.conf at apply1, called at src/Development/Shake/Internal/Rules/Oracle.hs:159:32 in shake-0.18.3-K6N2eLzVtai6jtZeWAmEIo:Development.Shake.Internal.Rules.Oracle* Depends on: OracleQ (ContextDataKey (Context {stage = Stage0, package = Package {pkgType = Library, pkgName = "ghc", pkgPath = "compiler"}, way = v})) at need, called at src/Hadrian/Oracles/Cabal/Rules.hs:53:9 in main:Hadrian.Oracles.Cabal.Rules* Depends on: _build/stage0/compiler/setup-config at need, called at src/Rules/Library.hs:151:18 in main:Rules.Library* Depends on: _build/stage0/libraries/ghci/build/libHSghci-8.11.0.20200309.a at need, called at src/Rules/Library.hs:146:5 in main:Rules.Library* Depends on: _build/stage0/libraries/ghci/build/GHCi/CreateBCO.o at &%>, called at src/Rules/Compile.hs:62:9 in main:Rules.Compile* Depends on: _build/stage0/libraries/ghci/build/GHCi/CreateBCO.o _build/stage0/libraries/ghci/build/GHCi/CreateBCO.hi* Raised the exception:user error (Development.Shake.cmd, system command failedCommand line: /home/hsyl20/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/bin/ghc -Wall -hisuf hi -osuf o -hcsuf hc -static -hide-all-packages -no-user-package-db '-package-db _build/stage0/lib/package.conf.d' '-this-unit-id ghci-8.11.0.20200309' '-package-id array-0.5.3.0' '-package-id base-4.12.0.0' '-package-id binary-0.8.7.0' '-package-id bytestring-0.10.8.2' '-package-id containers-0.6.0.1' '-package-id deepseq-1.4.4.0' '-package-id filepath-1.4.2.1' '-package-id ghc-boot-8.11.0.20200309' '-package-id ghc-boot-th-8.11.0.20200309' '-package-id ghc-heap-8.11.0.20200309' '-package-id template-haskell-2.16.0.0' '-package-id transformers-0.5.6.2' '-package-id unix-2.7.2.2' -i -i_build/stage0/libraries/ghci/build -i_build/stage0/libraries/ghci/build/autogen -ilibraries/ghci/. -I_build/stage0/lib -I_build/stage0/libraries/ghci/build -I/home/hsyl20/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/unix-2.7.2.2/include -I/home/hsyl20/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/time-1.8.0.2/include -I/home/hsyl20/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/bytestring-0.10.8.2/include -I/home/hsyl20/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/base-4.12.0.0/include -I/home/hsyl20/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/integer-gmp-1.0.2.0/include -I/home/hsyl20/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/include -I_build/stage0/lib -optc-I_build/stage0/lib -optP-include -optP_build/stage0/libraries/ghci/build/autogen/cabal_macros.h -optP-DHAVE_INTERNAL_INTERPRETER -outputdir _build/stage0/libraries/ghci/build -optc-Wno-error=inline -c libraries/ghci/GHCi/CreateBCO.hs -o _build/stage0/libraries/ghci/build/GHCi/CreateBCO.o -O0 -H64m -XHaskell2010 -XNoImplicitPrelude -fno-warn-deprecated-flagsExit code: 1Stderr:libraries/ghci/GHCi/CreateBCO.hs:73:51: error: Not in scope: type constructor or class ‘BCO’ Perhaps you meant ‘BCO#’ (imported from GHC.Exts) |73 | linkBCO' :: Array Int HValue -> ResolvedBCO -> IO BCO | ^^^libraries/ghci/GHCi/CreateBCO.hs:137:29: error: Not in scope: type constructor or class ‘BCO’ Perhaps you meant ‘BCO#’ (imported from GHC.Exts) |137 | writePtrsArrayBCO :: Int -> BCO -> PtrsArr -> IO () | ^^^libraries/ghci/GHCi/CreateBCO.hs:145:76: error: Not in scope: type constructor or class ‘BCO’ Perhaps you meant ‘BCO#’ (imported from GHC.Exts) |145 | newBCO :: ByteArray# -> ByteArray# -> Array# a -> Int# -> ByteArray# -> IO BCO | ^^^)