Hadrian Stack build script fails with error "Executable named hadrian not found on path"
Summary
Building GHC using hadrian/build.stack.sh -c -j
fails with error Executable named hadrian not found on path
Full console output:
WARNING: Ignoring out of range dependency (allow-newer enabled): Cabal-3.0.0.0. happy requires: <2.6
Cabal-3.0.0.0: configure (lib)
Cabal-3.0.0.0: build (lib)
Cabal-3.0.0.0: copy/register
happy-1.19.10: configure
Could not find custom-setup dep: Cabal
Log files have been written to: /home/james/Projects/ghc/hadrian/.stack-work/logs/
Progress 2/3
-- While building package happy-1.19.10 using:
/home/james/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/bin/ghc --make -odir /tmp/stack11818/happy-1.19.10/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/setup -hidir /tmp/stack11818/happy-1.19.10/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/setup -i -i. -clear-package-db -global-package-db -package-db=/home/james/.stack/snapshots/x86_64-linux-tinfo6/lts-13.21/8.6.5/pkgdb -package-db=/home/james/Projects/ghc/hadrian/.stack-work/install/x86_64-linux-tinfo6/lts-13.21/8.6.5/pkgdb -hide-all-packages -package=Cabal -package-id=base-4.12.0.0 -package-id=directory-1.3.3.0 -package-id=filepath-1.4.2.1 -optP-include -optP/tmp/stack11818/happy-1.19.10/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/setup/setup_macros.h /tmp/stack11818/happy-1.19.10/Setup.lhs /home/james/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs -main-is StackSetupShim.mainOverride -o /tmp/stack11818/happy-1.19.10/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/setup/setup -threaded
Process exited with code: ExitFailure 1
Logs have been written to: /home/james/Projects/ghc/hadrian/.stack-work/logs/happy-1.19.10.log
[1 of 2] Compiling Main ( /tmp/stack11818/happy-1.19.10/Setup.lhs, /tmp/stack11818/happy-1.19.10/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/setup/Main.o )
/tmp/stack11818/happy-1.19.10/Setup.lhs:48:22: error:
Variable not in scope:
rawSystemProgramConf
:: Distribution.Verbosity.Verbosity -> t -> ProgramDb -> t1
|
48 | let runProgram p = rawSystemProgramConf (fromFlagOrDefault normal (buildVerbosity flags))
| ^^^^^^^^^^^^^^^^^^^^
Executable named hadrian not found on path: ["/home/james/Projects/ghc/hadrian/.stack-work/install/x86_64-linux-tinfo6/lts-13.21/8.6.5/bin","/home/james/.stack/snapshots/x86_64-linux-tinfo6/lts-13.21/8.6.5/bin","/home/james/.stack/compiler-tools/x86_64-linux-tinfo6/ghc-8.6.5/bin","/home/james/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/bin","/usr/local/bin","/usr/bin","/bin","/usr/local/sbin","/usr/bin/site_perl","/usr/bin/vendor_perl","/usr/bin/core_perl"]
Steps to reproduce
Navigate to root GHC folder and run:
hadrian/build.stack.sh -c -j
Expected behavior
Stack builds Hadrian correctly and then builds GHC.
Environment
This works on my desktop (Manjaro/Arch), but not on my laptop (Antergos/Arch). I installed all the tools in the Arch guide here just in case https://gitlab.haskell.org/ghc/ghc/wikis/building/preparation/linux
- GHC version used: 8.6.5
- Operating System: 5.1.12-arch1-1-ARCH (Distro: Antergos Linux)
- System Architecture: x86-64