From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Help needed: Updating GHC to 8.4.3 Date: Fri, 17 Aug 2018 17:08:18 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqgMg-00051V-97 for guix-devel@gnu.org; Fri, 17 Aug 2018 11:08:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqgMc-0003Su-4r for guix-devel@gnu.org; Fri, 17 Aug 2018 11:08:38 -0400 Received: from sinope02.bbbm.mdc-berlin.de ([141.80.25.24]:52660) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqgMb-0003Hp-Je for guix-devel@gnu.org; Fri, 17 Aug 2018 11:08:34 -0400 Received: from localhost (localhost [127.0.0.1]) by sinope02.bbbm.mdc-berlin.de (Postfix) with ESMTP id C98C9124F1D2 for ; Fri, 17 Aug 2018 17:08:24 +0200 (CEST) Received: from sinope02.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (sinope02.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2UnO48GhyDdE for ; Fri, 17 Aug 2018 17:08:19 +0200 (CEST) Received: from SW-IT-P-CAS4.mdc-berlin.net (puck.citx.mdc-berlin.de [141.80.36.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by sinope02.bbbm.mdc-berlin.de (Postfix) with ESMTPS for ; Fri, 17 Aug 2018 17:08:19 +0200 (CEST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Guix, We need to update to GHC 8.4.3 because that=E2=80=99s the current version t= hat LTS Haskell depends on. (Some packages I=E2=80=99m working on already depe= nd 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 =E2=80=9Cghc-8=E2=80=9D package to =E2=80=9Cghc-8.0=E2=80=9D and s= ets the default GHC at =E2=80=9Cghc-8.0=E2=80=9D so that we can switch the default once it has bee= n 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=E2=80=99s an excer= pt from the end of the build phase: --8<---------------cut here---------------start------------->8--- =E2=80=A6 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 destin= ations for: sectionizeFields Warning: Distribution.Types.InstalledPackageInfo.FieldGrammar: could not fi= nd link destinations for: Basic Warning: Distribution.InstalledPackageInfo: could not find link destination= s 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 =E2=80=A6 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 Desugared= Mod 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=E2=80=99s how the check phase fails: --8<---------------cut here---------------start------------->8--- starting phase `check' make -C testsuite/tests CLEANUP=3D1 SUMMARY_FILE=3D../../testsuite_summary.= txt make[1]: Entering directory '/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/test= suite/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 [ $? !=3D 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: canno= t 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/test= suite/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 [ $? !=3D 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: canno= t 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/gh= c-stage1' > calibrate.out TimeMe: error while loading shared libraries: libgmp.so.10: cannot open sha= red 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/tests= uite/timeout' PYTHON=3D"python3" "python3" ../driver/runtests.py -e "ghc_compiler_always= _flags=3D'-dcore-lint -dcmm-lint -no-user- -rtsopts -dno-debug-output'" -e= config.compiler_debugged=3D -e ghc_with_native_codegen=3D0 -e config.have_= vanilla=3DTrue -e config.have_dynamic=3DTrue -e config.have_profiling=3DTru= e -e ghc_with_threaded_rts=3D0 -e ghc_with_dynamic_rts=3D0 -e config.have_i= nterp=3DTrue -e config.unregisterised=3DFalse -e config.ghc_dynamic_by_defa= ult=3DFalse -e config.ghc_dynamic=3DFalse -e ghc_with_smp=3D0 -e ghc_with_l= lvm=3D0 -e windows=3DFalse -e darwin=3DFalse -e config.in_tree_compiler=3DT= rue -e config.cleanup=3DTrue -e config.local=3DTrue --rootdir=3D. --config-= file=3D../config/ghc -e 'config.confdir=3D"../config"' -e 'config.platform= =3D""' -e 'config.os=3D""' -e 'config.arch=3D""' -e 'config.wordsize=3D""' = -e 'config.timeout=3Dint() or config.timeout' -e 'config.exeext=3D""' -e 'c= onfig.top=3D"/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/testsuite"' --config= 'compiler=3D"/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplace/bin/ghc-sta= ge2"' --config 'ghc_pkg=3D"/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.4.3/inplac= e/bin/ghc-pkg"' --config 'haddock=3D"/tmp/guix-build-ghc-8.4.3.drv-0/ghc-8.= 4.3/inplace/bin/haddock"' --config 'hp2ps=3D"/tmp/guix-build-ghc-8.4.3.drv-= 0/ghc-8.4.3/inplace/bin/hp2ps"' --config 'hpc=3D"/tmp/guix-build-ghc-8.4.3.= drv-0/ghc-8.4.3/inplace/bin/hpc"' --config 'gs=3D"gs"' --config 'timeout_pr= og=3D"../timeout/install-inplace/bin/timeout"' -e "config.stage=3D" --summa= ry-file "../../testsuite_summary.txt" --rootdir=3D../../libraries/array/t= ests --rootdir=3D../../libraries/base/tests --rootdir=3D../../libraries/b= inary/tests --rootdir=3D../../libraries/bytestring/tests --rootdir=3D../.= ./libraries/containers/tests --rootdir=3D../../libraries/deepseq/tests --= rootdir=3D../../libraries/directory/tests --rootdir=3D../../libraries/file= path/tests --rootdir=3D../../libraries/ghc-compact/tests --rootdir=3D../.= ./libraries/ghc-prim/tests --rootdir=3D../../libraries/haskeline/tests --= rootdir=3D../../libraries/hpc/tests --rootdir=3D../../libraries/pretty/tes= ts --rootdir=3D../../libraries/process/tests --rootdir=3D../../libraries/= stm/tests --rootdir=3D../../libraries/template-haskell/tests --rootdir=3D= ../../libraries/text/tests --rootdir=3D../../libraries/unix/tests \ \ \ \ \ \ \ Traceback (most recent call last): File "../driver/runtests.py", line 65, in exec(e) File "", line 1 config.compiler_debugged=3D ^ 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/tests= uite/tests' make: *** [Makefile:223: test] Error 2 --8<---------------cut here---------------end--------------->8--- It says =E2=80=9Cinvalid syntax=E2=80=9D because the value for =E2=80=9C$(G= hcDebugged)=E2=80=9D 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=E2=80=99t 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 file= s, ;; 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 a= rgs2 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 Noth= ing mb_env")) #t)) --8<---------------cut here---------------end--------------->8--- We are using =E2=80=9CrunSomethingFiltered=E2=80=9D instead of =E2=80=9CrunSomethingResponseFile=E2=80=9D, but I suppose something about t= he flags still isn=E2=80=99t quite right. Any ideas? Unfortunately, Nixpkgs wasn=E2=80=99t of much help in this case. AFAIU they modified their ld wrapper so that no patch of GHC is required. -- Ricardo --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename="0001-WIP-Add-ghc-8.4.3.patch" >From 7485bad6a8b8d826c8c8e8f818027c6a51433971 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 17 Aug 2018 16:55:43 +0200 Subject: [PATCH] WIP Add ghc 8.4.3 --- gnu/packages/haskell.scm | 113 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 2 deletions(-) diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index 7347c8753..d9e65ee4a 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -320,7 +320,7 @@ top of CLISP.") interactive environment for the functional language Haskell.") (license license:bsd-3))) -(define-public ghc-8 +(define-public ghc-8.0 (package (name "ghc") (version "8.0.2") @@ -432,7 +432,116 @@ interactive environment for the functional language Haskell.") interactive environment for the functional language Haskell.") (license license:bsd-3))) -(define-public ghc ghc-8) +(define-public ghc-8 + (package (inherit ghc-8.0) + (name "ghc") + (version "8.4.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.haskell.org/ghc/dist/" + version "/" name "-" version "-src.tar.xz")) + (sha256 + (base32 "1mk046vb561j75saz05rghhbkps46ym5aci4264dwc2qk3dayixf")) + (modules '((guix build utils))) + ;; 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)))) + (inputs + `(("gmp" ,gmp) + ("ncurses" ,ncurses) + ("libffi" ,libffi))) + (native-inputs + `(("perl" ,perl) + ("python" ,python) ; for tests + ("ghostscript" ,ghostscript) ; for tests + ;; GHC 8.4.3 is built with GHC 8. + ("ghc-bootstrap" ,ghc-8.0) + ("ghc-testsuite" + ,(origin + (method url-fetch) + (uri (string-append + "https://www.haskell.org/ghc/dist/" + version "/" name "-" version "-testsuite.tar.xz")) + (sha256 + (base32 "1z55b1z0m3plqd2d1ks6w5wvx7igm7zsk3i4v7cms003z0as0hzz")))))) + (arguments + `(#:test-target "test" + ;; We get a smaller number of test failures by disabling parallel test + ;; execution. + #:parallel-tests? #f + + ;; The DSOs use $ORIGIN to refer to each other, but (guix build + ;; gremlin) doesn't support it yet, so skip this phase. + #:validate-runpath? #f + + ;; Don't pass --build=, because the configure script + ;; auto-detects slightly different triplets for --host and --target and + ;; then complains that they don't match. + #:build #f + + #:configure-flags + (list + (string-append "--with-gmp-libraries=" + (assoc-ref %build-inputs "gmp") "/lib") + (string-append "--with-gmp-includes=" + (assoc-ref %build-inputs "gmp") "/include") + "--with-system-libffi" + (string-append "--with-ffi-libraries=" + (assoc-ref %build-inputs "libffi") "/lib") + (string-append "--with-ffi-includes=" + (assoc-ref %build-inputs "libffi") "/include") + (string-append "--with-curses-libraries=" + (assoc-ref %build-inputs "ncurses") "/lib") + (string-append "--with-curses-includes=" + (assoc-ref %build-inputs "ncurses") "/include")) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'unpack-testsuite + (lambda* (#:key inputs #:allow-other-keys) + (invoke "tar" "xvf" + (assoc-ref inputs "ghc-testsuite") + "--strip-components=1") + #t)) + (add-after 'unpack-testsuite 'fix-shell-wrappers + (lambda _ + (substitute* '("driver/ghci/ghc.mk" + "utils/mkdirhier/ghc.mk" + "rules/shell-wrapper.mk") + (("echo '#!/bin/sh'") + (format #f "echo '#!~a'" (which "sh")))) + #t)) + (add-before 'build 'fix-references + (lambda _ + (substitute* '("testsuite/timeout/Makefile" + "testsuite/timeout/timeout.py" + "testsuite/timeout/timeout.hs" + "testsuite/tests/programs/life_space_leak/life.test" + ;; libraries + "libraries/process/System/Process/Posix.hs" + "libraries/process/tests/process001.hs" + "libraries/process/tests/process002.hs" + "libraries/unix/cbits/execvpe.c") + (("/bin/sh") (which "sh")) + (("/bin/ls") (which "ls")) + (("/bin/rm") "rm")) + #t)) + (add-before 'build 'fix-environment + (lambda _ + (unsetenv "GHC_PACKAGE_PATH") + (setenv "CONFIG_SHELL" (which "bash")) + #t))))))) + +(define-public ghc ghc-8.0) (define-public ghc-hostname (package -- 2.18.0 --=-=-=--