Hi Guix, We need to update to GHC 8.4.3 because that’s the current version that LTS Haskell depends on. (Some packages I’m working on already depend on packages that only come with GHC 8.4.3.) Attached is a WIP patch to update GHC to 8.4.3. (The patch renames the existing “ghc-8” package to “ghc-8.0” and sets the default GHC at “ghc-8.0” so that we can switch the default once it has been fully built by the build farm.) The problem is: it does not work, although the build phase succeeds. Something with linking with other libraries fails. Here’s an excerpt from the end of the build phase: --8<---------------cut here---------------start------------->8--- … Warning: Distribution.Simple.Program: could not find link destinations for: findExecutable Warning: Distribution.Simple.Compiler: could not find link destinations for: extensionToFlag Warning: Distribution.Simple.Command: could not find link destinations for: FieldDescr Warning: Distribution.Simple.Setup: could not find link destinations for: programDbPaths dispModSubstEntry Warning: Distribution.PackageDescription.Configuration: could not find link destinations for: PDTagged PDNull Warning: Distribution.PackageDescription.Parsec: could not find link destinations for: sectionizeFields Warning: Distribution.Types.InstalledPackageInfo.FieldGrammar: could not find link destinations for: Basic Warning: Distribution.InstalledPackageInfo: could not find link destinations for: LineNo Warning: Distribution.Simple.PackageIndex: could not find link destinations for: DepUniqueKey Warning: Distribution.Simple.BuildTarget: could not find link destinations for: matchInexactly findMatch None Unambiguous Ambiguous Warning: Distribution.Simple.Build.Macros: could not find link destinations for: generateToolVersionMacros Warning: Distribution.Simple.GHC: could not find link destinations for: gbuild GBuildMode Warning: Distribution.Backpack.Configure: could not find link destinations for: PreExistingComponent … Warning: HscMain: could not find link destinations for: RenamedStuff Warning: TcSplice: could not find link destinations for: annotThType Warning: InteractiveEval: could not find link destinations for: RttiType Warning: GhcMake: could not find link destinations for: NodeMap BuildModule LogQueue upsweep CompilationGraph Warning: GHC: could not find link destinations for: OnOff LogOutput SseVersion BmiVersion modSummary tm_internals DesugaredMod WhetherHasFamInst holeUnitId Warning: DriverBkp: could not find link destinations for: BkpEnv BkpM backpackProgressMsg cd libraries && sh gen_contents_index --intree phase `build' succeeded after 2940.0 seconds --8<---------------cut here---------------end--------------->8--- Here’s how the check phase fails: --8<---------------cut here---------------start------------->8--- starting phase `check' make -C testsuite/tests CLEANUP=1 SUMMARY_FILE=../../testsuite_summary.txt make[1]: Entering directory '/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/testsuite/tests' "/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/ghc-stage2" --make -o ../mk/ghc-config ../mk/ghc-config.hs [1 of 1] Compiling Main ( ../mk/ghc-config.hs, ../mk/ghc-config.o ) Linking ../mk/ghc-config ... ../mk/ghc-config "/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/ghc-stage2" >"../mk/ghcconfig_tmp_guix-build-ghc-8.4.3.drv-0_ghc-8.4.3_inplace_bin_ghc-stage2.mk"; if [ $? != 0 ]; then rm -f "../mk/ghcconfig_tmp_guix-build-ghc-8.4.3.drv-0_ghc-8.4.3_inplace_bin_ghc-stage2.mk"; exit 1; fi ../mk/ghc-config: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory Looks like you don't have timeout, building it first... make -C ../timeout all make[2]: Entering directory '/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/testsuite/timeout' ../mk/ghc-config "/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/ghc-stage2" >"../mk/ghcconfig_tmp_guix-build-ghc-8.4.3.drv-0_ghc-8.4.3_inplace_bin_ghc-stage2.mk"; if [ $? != 0 ]; then rm -f "../mk/ghcconfig_tmp_guix-build-ghc-8.4.3.drv-0_ghc-8.4.3_inplace_bin_ghc-stage2.mk"; exit 1; fi ../mk/ghc-config: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory rm -f -f TimeMe.o TimeMe.hi TimeMe TimeMe.exe python3 calibrate '/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/ghc-stage1' > calibrate.out TimeMe: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory rm -rf install-inplace mkdir install-inplace mkdir install-inplace/bin cp timeout.py install-inplace/bin/timeout.py echo '#!/gnu/store/rbrandv7anzjxqkr40d7fkanzssslk4b-bash-minimal-4.4.19/bin/sh' > install-inplace/bin/timeout echo 'exec "python3" $0.py "$@"' >> install-inplace/bin/timeout chmod +x install-inplace/bin/timeout make[2]: Leaving directory '/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/testsuite/timeout' PYTHON="python3" "python3" ../driver/runtests.py -e "ghc_compiler_always_flags='-dcore-lint -dcmm-lint -no-user- -rtsopts -dno-debug-output'" -e config.compiler_debugged= -e ghc_with_native_codegen=0 -e config.have_vanilla=True -e config.have_dynamic=True -e config.have_profiling=True -e ghc_with_threaded_rts=0 -e ghc_with_dynamic_rts=0 -e config.have_interp=True -e config.unregisterised=False -e config.ghc_dynamic_by_default=False -e config.ghc_dynamic=False -e ghc_with_smp=0 -e ghc_with_llvm=0 -e windows=False -e darwin=False -e config.in_tree_compiler=True -e config.cleanup=True -e config.local=True --rootdir=. --config-file=../config/ghc -e 'config.confdir="../config"' -e 'config.platform=""' -e 'config.os=""' -e 'config.arch=""' -e 'config.wordsize=""' -e 'config.timeout=int() or config.timeout' -e 'config.exeext=""' -e 'config.top="/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/testsuite"' --config 'compiler="/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/ghc-stage2"' --config 'ghc_pkg="/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/ghc-pkg"' --config 'haddock="/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/haddock"' --config 'hp2ps="/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/hp2ps"' --config 'hpc="/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/hpc"' --config 'gs="gs"' --config 'timeout_prog="../timeout/install-inplace/bin/timeout"' -e "config.stage=" --summary-file "../../testsuite_summary.txt" --rootdir=../../libraries/array/tests --rootdir=../../libraries/base/tests --rootdir=../../libraries/binary/tests --rootdir=../../libraries/bytestring/tests --rootdir=../../libraries/containers/tests --rootdir=../../libraries/deepseq/tests --rootdir=../../libraries/directory/tests --rootdir=../../libraries/filepath/tests --rootdir=../../libraries/ghc-compact/tests --rootdir=../../libraries/ghc-prim/tests --rootdir=../../libraries/haskeline/tests --rootdir=../../libraries/hpc/tests --rootdir=../../libraries/pretty/tests --rootdir=../../libraries/process/tests --rootdir=../../libraries/stm/tests --rootdir=../../libraries/template-haskell/tests --rootdir=../../libraries/text/tests --rootdir=../../libraries/unix/tests \ \ \ \ \ \ \ Traceback (most recent call last): File "../driver/runtests.py", line 65, in exec(e) File "", line 1 config.compiler_debugged= ^ SyntaxError: invalid syntax make[1]: *** [../mk/test.mk:303: test] Error 1 make[1]: Leaving directory '/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/testsuite/tests' make: *** [Makefile:223: test] Error 2 --8<---------------cut here---------------end--------------->8--- It says “invalid syntax” because the value for “$(GhcDebugged)” is unavailable, because the ghc-config stuff above failed. GHC 8.0 had been patched with "ghc-dont-pass-linker-flags-via-response-files.patch" to avoid using response files with the linker, because our ld-wrapper doesn’t seem to behave right in some edge case that GHC depends on. I tried porting the patch to GHC 8.4.3 by applying this snippet: --8<---------------cut here---------------start------------->8--- ;; FIXME: Our ld-wrapper does not seem to fully support response files, ;; thus breaking the build. We use "runSomethingFiltered" instead of ;; "runSomethingResponseFile" to work around this problem. Note the ;; slightly different type. (snippet '(begin (substitute* "compiler/main/SysTools/Tasks.hs" (("runSomethingResponseFile dflags cc_filter \"C Compiler\" p args2 mb_env") "runSomethingFiltered dflags cc_filter \"C Compiler\" p args2 Nothing mb_env") (("runSomethingResponseFile dflags ld_filter \"Linker\" p args2 mb_env") "runSomethingFiltered dflags ld_filter \"Linker\" p args2 Nothing mb_env")) #t)) --8<---------------cut here---------------end--------------->8--- We are using “runSomethingFiltered” instead of “runSomethingResponseFile”, but I suppose something about the flags still isn’t quite right. Any ideas? Unfortunately, Nixpkgs wasn’t of much help in this case. AFAIU they modified their ld wrapper so that no patch of GHC is required. -- Ricardo