guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/27: gnu: Add ghc-8.6.


From: guix-commits
Subject: 01/27: gnu: Add ghc-8.6.
Date: Thu, 1 Aug 2019 12:07:08 -0400 (EDT)

rob pushed a commit to branch wip-haskell-updates
in repository guix.

commit 2fa697194542d6af2cd1d2504f7f16f8fc7e8d53
Author: Robert Vollmert <address@hidden>
Date:   Tue Jul 16 08:45:40 2019 +0200

    gnu: Add ghc-8.6.
    
    This is exactly like GHC 8.4, except for:
    - the sources
    - depends on ghc-8.4 as ghc-bootstrap, since it has a
      minimum requirement of GHC 8.2 as a bootstrap compiler
    - explicitly skip two failing tests
    - skip performance tests
    
    (Apparently, those tests also fail on older versions, but
    a failing test suite did not cause a build failure.)
    
     * gnu/packages/haskell.scm (ghc-8.6): New package.
    (ghc-8): Rename to ghc-8.4.
    (ghc): Refer to ghc-8.4.
    * gnu/packages/patches/ghc-8.6.5-skip-tests.patch: New patch.
    * gnu/packages/local.mk: New patch.
---
 gnu/local.mk                                    |   1 +
 gnu/packages/haskell.scm                        | 137 +++++++++++++++++++++++-
 gnu/packages/patches/ghc-8.6.5-skip-tests.patch |  20 ++++
 3 files changed, 156 insertions(+), 2 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index bd50964..651d5ab 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -852,6 +852,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/gdm-CVE-2018-14424.patch                        \
   %D%/packages/patches/geoclue-config.patch                    \
   %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \
+  %D%/packages/patches/ghc-8.6.5-skip-tests.patch              \
   %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch     
\
   %D%/packages/patches/ghc-haddock-library-unbundle.patch              \
   %D%/packages/patches/ghostscript-no-header-id.patch          \
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index bced445..9adae1e 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -440,7 +440,7 @@ interactive environment for the functional language 
Haskell.")
 interactive environment for the functional language Haskell.")
     (license license:bsd-3)))
 
-(define-public ghc-8
+(define-public ghc-8.4
   (package (inherit ghc-8.0)
     (name "ghc")
     (version "8.4.3")
@@ -572,7 +572,140 @@ interactive environment for the functional language 
Haskell.")
                                 (file-pattern ".*\\.conf\\.d$")
                                 (file-type 'directory))))))
 
-(define-public ghc ghc-8)
+(define-public ghc-8.6
+  (package (inherit ghc-8.4)
+    (name "ghc")
+    (version "8.6.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://www.haskell.org/ghc/dist/";
+                           version "/" name "-" version "-src.tar.xz"))
+       (sha256
+        (base32 "0qg3zsmbk4rkwkc3jpas3zs74qaxmw4sp4v1mhsbj0a0dzls2jjd"))))
+    (native-inputs
+     `(("perl" ,perl)
+       ("python" ,python)               ; for tests
+       ("ghostscript" ,ghostscript)     ; for tests
+       ;; GHC 8.6.5 must be built with GHC >= 8.2.
+       ("ghc-bootstrap" ,ghc-8.4)
+       ;; test patch must be applied after unpacking test suite
+       ("ghc-skip-tests-patch" ,(car (search-patches 
"ghc-8.6.5-skip-tests.patch")))
+       ("ghc-testsuite"
+        ,(origin
+           (method url-fetch)
+           (uri (string-append
+                 "https://www.haskell.org/ghc/dist/";
+                 version "/" name "-" version "-testsuite.tar.xz"))
+           (sha256
+            (base32
+             "0pw9r91g2np3i806g2f4f8z4jfdd7mx226cmdizk4swa7av1qf91"))))))
+    (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=<triplet>, because the configure script
+       ;; auto-detects slightly different triplets for --host and --target and
+       ;; then complains that they don't match.
+       #:build #f
+
+       #:make-flags
+       (list
+        "EXTRA_RUNTEST_OPTS=--skip-perf-tests")
+
+       #: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 'patch-out-broken-tests
+           (lambda* (#:key inputs #:allow-other-keys)
+             (invoke "patch" "-p2" "-i" (assoc-ref inputs 
"ghc-skip-tests-patch"))))
+         (add-after 'patch-out-broken-tests '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))
+         ;; This phase patches the 'ghc-pkg' command so that it sorts the list
+         ;; of packages in the binary cache it generates.
+         (add-before 'build 'fix-ghc-pkg-nondeterminism
+           (lambda _
+             (substitute* "utils/ghc-pkg/Main.hs"
+               (("confs = map \\(path </>\\) \\$ filter \\(\".conf\" 
`isSuffixOf`\\) fs")
+                "confs = map (path </>) $ filter (\".conf\" `isSuffixOf`) 
(sort fs)"))
+             #t))
+         ;; This is necessary because the configure system no longer uses
+         ;; “AC_PATH_” but “AC_CHECK_”, setting the variables to just the
+         ;; plain command names.
+         (add-before 'configure 'set-target-programs
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((binutils (assoc-ref inputs "target-binutils"))
+                   (gcc (assoc-ref inputs "target-gcc"))
+                   (ld-wrapper (assoc-ref inputs "target-ld-wrapper")))
+               (setenv "CC" (string-append gcc "/bin/gcc"))
+               (setenv "CXX" (string-append gcc "/bin/g++"))
+               (setenv "LD" (string-append ld-wrapper "/bin/ld"))
+               (setenv "NM" (string-append binutils "/bin/nm"))
+               (setenv "RANLIB" (string-append binutils "/bin/ranlib"))
+               (setenv "STRIP" (string-append binutils "/bin/strip"))
+               ;; The 'ar' command does not follow the same pattern.
+               (setenv "fp_prog_ar" (string-append binutils "/bin/ar"))
+               #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)))))
+    (native-search-paths (list (search-path-specification
+                                (variable "GHC_PACKAGE_PATH")
+                                (files (list
+                                        (string-append "lib/ghc-" version)))
+                                (file-pattern ".*\\.conf\\.d$")
+                                (file-type 'directory))))))
+
+(define-public ghc ghc-8.4)
 
 (define-public ghc-hostname
   (package
diff --git a/gnu/packages/patches/ghc-8.6.5-skip-tests.patch 
b/gnu/packages/patches/ghc-8.6.5-skip-tests.patch
new file mode 100644
index 0000000..764976d
--- /dev/null
+++ b/gnu/packages/patches/ghc-8.6.5-skip-tests.patch
@@ -0,0 +1,20 @@
+diff -ur a/ghc-8.6.5/libraries/unix/tests/all.T 
b/ghc-8.6.5/libraries/unix/tests/all.T
+--- a/ghc-8.6.5/libraries/unix/tests/all.T     2019-07-25 10:33:26.860000000 
+0200
++++ b/ghc-8.6.5/libraries/unix/tests/all.T     2019-07-25 10:38:49.348000000 
+0200
+@@ -71,4 +71,4 @@
+ test('processGroup002', normal, compile_and_run, ['-package unix'])
+ test('executeFile001', omit_ways(prof_ways), compile_and_run, ['-package 
unix'])
+ 
+-test('T8108', normal, compile_and_run, ['-package unix'])
++test('T8108', skip, compile_and_run, ['-package unix'])
+diff -ur a/ghc-8.6.5/libraries/unix/tests/libposix/all.T 
b/ghc-8.6.5/libraries/unix/tests/libposix/all.T
+--- a/ghc-8.6.5/libraries/unix/tests/libposix/all.T    2019-07-25 
10:33:26.856000000 +0200
++++ b/ghc-8.6.5/libraries/unix/tests/libposix/all.T    2019-07-25 
10:39:15.292000000 +0200
+@@ -11,6 +11,6 @@
+ 
+ test('posix006', reqlib('unix'), compile_and_run, [''])
+ test('posix009', [ omit_ways(threaded_ways), reqlib('unix') ], 
compile_and_run, [''])
+-test('posix010', reqlib('unix'), compile_and_run, [''])
++test('posix010', [ skip, reqlib('unix') ], compile_and_run, [''])
+ 
+ test('posix014', [ reqlib('unix') ], compile_and_run, [''])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]