* [bug#36692] [PATCH 1/2] gnu: Rename ghc-8 to ghc-8.4
2019-07-16 15:47 [bug#36692] [PATCH 0/2] Add GHC 8.6.5 Robert Vollmert
@ 2019-07-16 15:48 ` Robert Vollmert
2019-07-16 15:48 ` [bug#36692] [PATCH 2/2] gnu: Add GHC 8.6.5 Robert Vollmert
2019-07-16 16:00 ` [bug#36692] test failures Robert Vollmert
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Robert Vollmert @ 2019-07-16 15:48 UTC (permalink / raw)
To: 36692; +Cc: Robert Vollmert
Seems misleading to have ghc-8 pointing at ghc-8.4, if ghc-8.6
is also packaged.
* gnu/packages/haskell.scm (ghc-8): Rename to ghc-8.4.
(ghc): Refer to ghc-8.4.
---
gnu/packages/haskell.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index a5c1aa27da..09618738b6 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,7 @@ interactive environment for the functional language Haskell.")
(file-pattern ".*\\.conf\\.d$")
(file-type 'directory))))))
-(define-public ghc ghc-8)
+(define-public ghc ghc-8.4)
(define-public ghc-hostname
(package
--
2.20.1 (Apple Git-117)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#36692] [PATCH 2/2] gnu: Add GHC 8.6.5
2019-07-16 15:48 ` [bug#36692] [PATCH 1/2] gnu: Rename ghc-8 to ghc-8.4 Robert Vollmert
@ 2019-07-16 15:48 ` Robert Vollmert
0 siblings, 0 replies; 12+ messages in thread
From: Robert Vollmert @ 2019-07-16 15:48 UTC (permalink / raw)
To: 36692; +Cc: Robert Vollmert
This is exactly like GHC 8.4, except for the sources, and
depending on ghc-8.4 as ghc-bootstrap, since GHC 8.6
expects at least version 8.2.
* gnu/packages/haskell.scm (ghc-8.6): New field.
---
gnu/packages/haskell.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 09618738b6..a8657f0b97 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -572,6 +572,33 @@ interactive environment for the functional language Haskell.")
(file-pattern ".*\\.conf\\.d$")
(file-type 'directory))))))
+(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)
+ ("ghc-testsuite"
+ ,(origin
+ (method url-fetch)
+ (uri (string-append
+ "https://www.haskell.org/ghc/dist/"
+ version "/" name "-" version "-testsuite.tar.xz"))
+ (sha256
+ (base32
+ "0pw9r91g2np3i806g2f4f8z4jfdd7mx226cmdizk4swa7av1qf91"))))))))
+
(define-public ghc ghc-8.4)
(define-public ghc-hostname
--
2.20.1 (Apple Git-117)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#36692] test failures
2019-07-16 15:47 [bug#36692] [PATCH 0/2] Add GHC 8.6.5 Robert Vollmert
2019-07-16 15:48 ` [bug#36692] [PATCH 1/2] gnu: Rename ghc-8 to ghc-8.4 Robert Vollmert
@ 2019-07-16 16:00 ` Robert Vollmert
2019-07-16 16:28 ` Marius Bakke
2019-07-16 18:58 ` [bug#36692] [PATCH 1/2] gnu: ghc@8.6.5: Duplicate build arguments from ghc-8.4 Robert Vollmert
2019-07-16 19:47 ` [bug#36692] [PATCH (unified, replaces previous patches)] gnu: Add GHC 8.6.5 Robert Vollmert
3 siblings, 1 reply; 12+ messages in thread
From: Robert Vollmert @ 2019-07-16 16:00 UTC (permalink / raw)
To: 36692
I was able to run both tests from the build directory in /tmp,
and they both passed fine. Also they both involve user ids, I
suspect those might differ in the build container?
main = do
void $ forkIO $ forever $ getGroupEntryForID 0
void $ forkIO $ forever $ getGroupEntryForID 0
threadDelay (3*1000*1000)
main = do
root <- getUserEntryForName "root"
putStrLn (ue2String root)
root' <- getUserEntryForID (userID root)
putStrLn (ue2String root')
if homeDirectory root == homeDirectory root' &&
userShell root == userShell root'
then putStrLn "OK"
else putStrLn “Mismatch"
^ permalink raw reply [flat|nested] 12+ messages in thread
* [bug#36692] test failures
2019-07-16 16:00 ` [bug#36692] test failures Robert Vollmert
@ 2019-07-16 16:28 ` Marius Bakke
2019-07-16 16:36 ` Robert Vollmert
2019-07-16 19:00 ` Robert Vollmert
0 siblings, 2 replies; 12+ messages in thread
From: Marius Bakke @ 2019-07-16 16:28 UTC (permalink / raw)
To: Robert Vollmert, 36692
[-- Attachment #1: Type: text/plain, Size: 936 bytes --]
Robert Vollmert <rob@vllmrt.net> writes:
> I was able to run both tests from the build directory in /tmp,
> and they both passed fine. Also they both involve user ids, I
> suspect those might differ in the build container?
>
> main = do
> void $ forkIO $ forever $ getGroupEntryForID 0
> void $ forkIO $ forever $ getGroupEntryForID 0
> threadDelay (3*1000*1000)
>
> main = do
> root <- getUserEntryForName "root"
> putStrLn (ue2String root)
> root' <- getUserEntryForID (userID root)
> putStrLn (ue2String root')
> if homeDirectory root == homeDirectory root' &&
> userShell root == userShell root'
> then putStrLn "OK"
> else putStrLn “Mismatch"
The only reliable user ID available in the build container is 'nobody'
with UID and GID 65534 and the (see nix/libstore/build.cc:1862).
You can likely patch these tests to refer to that instead.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [bug#36692] test failures
2019-07-16 16:28 ` Marius Bakke
@ 2019-07-16 16:36 ` Robert Vollmert
2019-07-16 16:45 ` Marius Bakke
2019-07-16 19:00 ` Robert Vollmert
1 sibling, 1 reply; 12+ messages in thread
From: Robert Vollmert @ 2019-07-16 16:36 UTC (permalink / raw)
To: Marius Bakke; +Cc: 36692
> On 16. Jul 2019, at 18:28, Marius Bakke <mbakke@fastmail.com> wrote:
>
> Robert Vollmert <rob@vllmrt.net> writes:
>
>> I was able to run both tests from the build directory in /tmp,
>> and they both passed fine. Also they both involve user ids, I
>> suspect those might differ in the build container?
>>
>> main = do
>> void $ forkIO $ forever $ getGroupEntryForID 0
>> void $ forkIO $ forever $ getGroupEntryForID 0
>> threadDelay (3*1000*1000)
>>
>> main = do
>> root <- getUserEntryForName "root"
>> putStrLn (ue2String root)
>> root' <- getUserEntryForID (userID root)
>> putStrLn (ue2String root')
>> if homeDirectory root == homeDirectory root' &&
>> userShell root == userShell root'
>> then putStrLn "OK"
>> else putStrLn “Mismatch"
>
> The only reliable user ID available in the build container is 'nobody'
> with UID and GID 65534 and the (see nix/libstore/build.cc:1862).
>
> You can likely patch these tests to refer to that instead.
Thanks, I’ll give that a shot!
There’s something I don’t understand: Comments above the definition
of ghc-7 mention test failures, particularly one of these (posix010):
;; - Test posix010 tries to check the existence of a user on the system:
;; getUserEntryForName: does not exist (no such user)
But I don’t see any place in the definitions of any of the GHC packages
(ghc-7, ghc-8.0, ghc-8.4) that patch any tests out, and tests aren’t
disabled either. So how can these packages apparently be fine?
^ permalink raw reply [flat|nested] 12+ messages in thread
* [bug#36692] test failures
2019-07-16 16:36 ` Robert Vollmert
@ 2019-07-16 16:45 ` Marius Bakke
0 siblings, 0 replies; 12+ messages in thread
From: Marius Bakke @ 2019-07-16 16:45 UTC (permalink / raw)
To: Robert Vollmert; +Cc: 36692
[-- Attachment #1: Type: text/plain, Size: 3313 bytes --]
Robert Vollmert <rob@vllmrt.net> writes:
>> On 16. Jul 2019, at 18:28, Marius Bakke <mbakke@fastmail.com> wrote:
>>
>> Robert Vollmert <rob@vllmrt.net> writes:
>>
>>> I was able to run both tests from the build directory in /tmp,
>>> and they both passed fine. Also they both involve user ids, I
>>> suspect those might differ in the build container?
>>>
>>> main = do
>>> void $ forkIO $ forever $ getGroupEntryForID 0
>>> void $ forkIO $ forever $ getGroupEntryForID 0
>>> threadDelay (3*1000*1000)
>>>
>>> main = do
>>> root <- getUserEntryForName "root"
>>> putStrLn (ue2String root)
>>> root' <- getUserEntryForID (userID root)
>>> putStrLn (ue2String root')
>>> if homeDirectory root == homeDirectory root' &&
>>> userShell root == userShell root'
>>> then putStrLn "OK"
>>> else putStrLn “Mismatch"
>>
>> The only reliable user ID available in the build container is 'nobody'
>> with UID and GID 65534 and the (see nix/libstore/build.cc:1862).
>>
>> You can likely patch these tests to refer to that instead.
>
> Thanks, I’ll give that a shot!
>
>
> There’s something I don’t understand: Comments above the definition
> of ghc-7 mention test failures, particularly one of these (posix010):
>
> ;; - Test posix010 tries to check the existence of a user on the system:
> ;; getUserEntryForName: does not exist (no such user)
>
> But I don’t see any place in the definitions of any of the GHC packages
> (ghc-7, ghc-8.0, ghc-8.4) that patch any tests out, and tests aren’t
> disabled either. So how can these packages apparently be fine?
It looks like failing tests don't cause these builds to fail for some
reason.
Here is an excerpt from the GHC 7 build log on 'core-updates' [0]:
Unexpected results from:
TEST="T8108 process002 process001 posix010 exec_signals T9203 T9961 parsing001 haddock.base"
OVERALL SUMMARY for test run started at Wed Jul 10 09:03:57 2019 UTC
0:59:45 spent to go through
4434 total tests, which gave rise to
17996 test cases, of which
13907 were skipped
49 had missing libraries
3989 expected passes
42 expected failures
1 caused framework failures
0 unexpected passes
5 unexpected failures
4 unexpected stat failures
Unexpected failures:
../../libraries/process/tests process001 [bad exit code] (normal)
../../libraries/process/tests process002 [bad exit code] (normal)
../../libraries/unix/tests T8108 [bad stderr] (normal)
../../libraries/unix/tests/libposix posix010 [bad exit code] (normal)
rts exec_signals [bad exit code] (normal)
Unexpected stat failures:
perf/compiler T9961 [stat not good enough] (normal)
perf/compiler parsing001 [stat too good] (normal)
perf/haddock haddock.base [stat too good] (normal)
perf/should_run T9203 [stat too good] (normal)
make[2]: Leaving directory '/tmp/guix-build-ghc-7.10.2.drv-0/ghc-7.10.2/testsuite/tests'
make[1]: Leaving directory '/tmp/guix-build-ghc-7.10.2.drv-0/ghc-7.10.2/testsuite/tests'
phase `check' succeeded after 3588.0 seconds
[0]: https://ci.guix.gnu.org/log/42f20g43jaxs27jd407wn6fad9cpwjf7-ghc-7.10.2
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [bug#36692] test failures
2019-07-16 16:28 ` Marius Bakke
2019-07-16 16:36 ` Robert Vollmert
@ 2019-07-16 19:00 ` Robert Vollmert
1 sibling, 0 replies; 12+ messages in thread
From: Robert Vollmert @ 2019-07-16 19:00 UTC (permalink / raw)
To: Marius Bakke; +Cc: 36692
> On 16. Jul 2019, at 18:28, Marius Bakke <mbakke@fastmail.com> wrote:
>
> Robert Vollmert <rob@vllmrt.net> writes:
>
>> I was able to run both tests from the build directory in /tmp,
>> and they both passed fine. Also they both involve user ids, I
>> suspect those might differ in the build container?
>>
>> main = do
>> void $ forkIO $ forever $ getGroupEntryForID 0
>> void $ forkIO $ forever $ getGroupEntryForID 0
>> threadDelay (3*1000*1000)
>>
>> main = do
>> root <- getUserEntryForName "root"
>> putStrLn (ue2String root)
>> root' <- getUserEntryForID (userID root)
>> putStrLn (ue2String root')
>> if homeDirectory root == homeDirectory root' &&
>> userShell root == userShell root'
>> then putStrLn "OK"
>> else putStrLn “Mismatch"
>
> The only reliable user ID available in the build container is 'nobody'
> with UID and GID 65534 and the (see nix/libstore/build.cc:1862).
>
> You can likely patch these tests to refer to that instead.
I chose to skip them instead — specializing them to nobody/65534 doesn’t
seem helpful in the end.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [bug#36692] [PATCH 1/2] gnu: ghc@8.6.5: Duplicate build arguments from ghc-8.4
2019-07-16 15:47 [bug#36692] [PATCH 0/2] Add GHC 8.6.5 Robert Vollmert
2019-07-16 15:48 ` [bug#36692] [PATCH 1/2] gnu: Rename ghc-8 to ghc-8.4 Robert Vollmert
2019-07-16 16:00 ` [bug#36692] test failures Robert Vollmert
@ 2019-07-16 18:58 ` Robert Vollmert
2019-07-16 18:58 ` [bug#36692] [PATCH 2/2] gnu: ghc@8.6.5: Skip failing tests Robert Vollmert
2019-07-16 19:47 ` [bug#36692] [PATCH (unified, replaces previous patches)] gnu: Add GHC 8.6.5 Robert Vollmert
3 siblings, 1 reply; 12+ messages in thread
From: Robert Vollmert @ 2019-07-16 18:58 UTC (permalink / raw)
To: 36692; +Cc: Robert Vollmert
In preparation of skipping tests.
* gnu/packages/haskell.scm (ghc-8.6): Copy argument,
native-search-paths from ghc-8.4.
---
gnu/packages/haskell.scm | 99 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 98 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 65d8d75950..0d53f16b2a 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -597,7 +597,104 @@ interactive environment for the functional language Haskell.")
version "/" name "-" version "-testsuite.tar.xz"))
(sha256
(base32
- "0pw9r91g2np3i806g2f4f8z4jfdd7mx226cmdizk4swa7av1qf91"))))))))
+ "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
+
+ #: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))
+ ;; 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))
+ (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))
+ ;; 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)
--
2.20.1 (Apple Git-117)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#36692] [PATCH 2/2] gnu: ghc@8.6.5: Skip failing tests
2019-07-16 18:58 ` [bug#36692] [PATCH 1/2] gnu: ghc@8.6.5: Duplicate build arguments from ghc-8.4 Robert Vollmert
@ 2019-07-16 18:58 ` Robert Vollmert
0 siblings, 0 replies; 12+ messages in thread
From: Robert Vollmert @ 2019-07-16 18:58 UTC (permalink / raw)
To: 36692; +Cc: Robert Vollmert
These two tests require the existence of user root with id 0.
* gnu/packages/haskell.scm (ghc-8.6): Add phase 'skip-tests.
---
gnu/packages/haskell.scm | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 0d53f16b2a..e672ea9232 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -636,6 +636,14 @@ interactive environment for the functional language Haskell.")
(assoc-ref inputs "ghc-testsuite")
"--strip-components=1")
#t))
+ ;; These two tests refer to the root user, which doesn't exist.
+ (add-after 'unpack-testsuite 'skip-tests
+ (lambda _
+ (substitute* "libraries/unix/tests/all.T"
+ (("^test\\('T8108'") "# guix skipped: test('T8108'"))
+ (substitute* "libraries/unix/tests/libposix/all.T"
+ (("^test\\('posix010'") "# guix skipped: test('posix010'"))
+ #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
--
2.20.1 (Apple Git-117)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#36692] [PATCH (unified, replaces previous patches)] gnu: Add GHC 8.6.5
2019-07-16 15:47 [bug#36692] [PATCH 0/2] Add GHC 8.6.5 Robert Vollmert
` (2 preceding siblings ...)
2019-07-16 18:58 ` [bug#36692] [PATCH 1/2] gnu: ghc@8.6.5: Duplicate build arguments from ghc-8.4 Robert Vollmert
@ 2019-07-16 19:47 ` Robert Vollmert
2019-08-08 4:26 ` bug#36692: " Timothy Sample
3 siblings, 1 reply; 12+ messages in thread
From: Robert Vollmert @ 2019-07-16 19:47 UTC (permalink / raw)
To: 36692; +Cc: Robert Vollmert
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
(Apparently, those tests also fail on older versions, but
for unclear reasons the packages still build successfully.)
* gnu/packages/haskell.scm (ghc-8.6): New field.
(ghc-8): Rename to ghc-8.4.
(ghc): Refer to ghc-8.4.
---
gnu/packages/haskell.scm | 136 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 134 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index 4f0ab5825c..6b5662298f 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,139 @@ 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)
+ ("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
+
+ #: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))
+ ;; These two tests refer to the root user, which doesn't exist.
+ (add-after 'unpack-testsuite 'skip-tests
+ (lambda _
+ (substitute* "libraries/unix/tests/all.T"
+ (("^test\\('T8108'") "# guix skipped: test('T8108'"))
+ (substitute* "libraries/unix/tests/libposix/all.T"
+ (("^test\\('posix010'") "# guix skipped: test('posix010'"))
+ #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))
+ (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))
+ ;; 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
--
2.20.1 (Apple Git-117)
^ permalink raw reply related [flat|nested] 12+ messages in thread
* bug#36692: [PATCH (unified, replaces previous patches)] gnu: Add GHC 8.6.5
2019-07-16 19:47 ` [bug#36692] [PATCH (unified, replaces previous patches)] gnu: Add GHC 8.6.5 Robert Vollmert
@ 2019-08-08 4:26 ` Timothy Sample
0 siblings, 0 replies; 12+ messages in thread
From: Timothy Sample @ 2019-08-08 4:26 UTC (permalink / raw)
To: Robert Vollmert; +Cc: 36692-done
Hi Robert,
Robert Vollmert <rob@vllmrt.net> writes:
> 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
I simplified the package by reusing the inputs and arguments from
“ghc-8.4”. I also made changing “ghc-8” its own commit.
Pushed as a62ddb748f–cce84c34cd. Thanks!
> (Apparently, those tests also fail on older versions, but
> for unclear reasons the packages still build successfully.)
It would be nice if we could make the old versions fail and fix or
disable the failing tests.
-- Tim
^ permalink raw reply [flat|nested] 12+ messages in thread