GNU bug report logs - #36692
[PATCH 0/2] Add GHC 8.6.5

Previous Next

Package: guix-patches;

Reported by: Robert Vollmert <rob <at> vllmrt.net>

Date: Tue, 16 Jul 2019 15:48:01 UTC

Severity: normal

Tags: patch

Done: Timothy Sample <samplet <at> ngyro.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36692 in the body.
You can then email your comments to 36692 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 15:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Robert Vollmert <rob <at> vllmrt.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 16 Jul 2019 15:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: guix-patches <at> gnu.org
Cc: Robert Vollmert <rob <at> vllmrt.net>
Subject: [PATCH 0/2] Add GHC 8.6.5
Date: Tue, 16 Jul 2019 17:47:32 +0200
Seemed like a good idea to have current GHC packaged. This almost works,
except for two real test failures (not sure if these are just on my system),
and some more "stat failures". It would be neat if someone could run the
build and see if they get the same failures.

Unexpected results from:
TEST="T5631 T8108 T9203 T9630 haddock.Cabal haddock.base parsing001 posix010"

SUMMARY for test run started at Tue Jul 16 12:47:07 2019 UTC
 2:44:36 spent to go through
    6525 total tests, which gave rise to
   25446 test cases, of which
   18529 were skipped

      41 had missing libraries
    6782 expected passes
      86 expected failures

       0 caused framework failures
       0 caused framework warnings
       0 unexpected passes
       2 unexpected failures
       6 unexpected stat failures

Unexpected failures:
   ../../libraries/unix/tests/T8108.run              T8108 [bad stderr] (normal)
   ../../libraries/unix/tests/libposix/posix010.run  posix010 [bad exit code] (normal)

Unexpected stat failures:
   perf/compiler/T5631.run         T5631 [stat too good] (normal)
   perf/compiler/parsing001.run    parsing001 [stat too good] (normal)
   perf/compiler/T9630.run         T9630 [stat not good enough] (normal)
   perf/haddock/haddock.base.run   haddock.base [stat too good] (normal)
   perf/haddock/haddock.Cabal.run  haddock.Cabal [stat too good] (normal)
   perf/should_run/T9203.run       T9203 [stat too good] (normal)


First failure:

cd "../../libraries/unix/tests/T8108.run" &&  "/tmp/guix-build-ghc-8.6.5.drv-0/ghc-8.6.5/inplace/bin/ghc-stage2" -o T8108 T8108.hs -dcore-lint -dcmm-lint -no-user-package-db -rtso
pts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -dno-debug-output  -package unix
cd "../../libraries/unix/tests/T8108.run" && ./T8108  
Actual stderr output differs from expected:
diff -uw "/dev/null" "../../libraries/unix/tests/T8108.run/T8108.run.stderr.normalised"
*** unexpected failure for T8108(normal)


Second failure:

cd "../../libraries/unix/tests/libposix/posix010.run" && ./posix010  
Wrong exit code for posix010(normal)(expected 0 , actual 1 )
Stderr ( posix010 ):
posix010: getUserEntryForName: does not exist (no such user)
*** unexpected failure for posix010(normal)

Dmesg output, possibly related:

[250906.659949] derefnull[32322]: segfault at 0 ip 0000000000405bd1 sp 00007fffffff90e8 error 4 in derefnull[402000+88000]
[250906.659980] Code: 00 00 00 e9 99 4a 07 00 90 00 00 00 00 00 00 00 00 1e 00 00 00 00 00 00 00 49 83 c4 10 4d 3b a5 58 03 00 00 77 d2 48 8b 43 07 <48> 8b 00 4
9 c7 44 24 f8 98 3c 46 00 49 89 04 24 49 8d 5c 24 f9 48
[250908.941498] traps: divbyzero[32344] trap divide error ip:46308f sp:7fffffff90e8 error:0 in divbyzero[402000+88000]


Robert Vollmert (2):
  gnu: Rename ghc-8 to ghc-8.4
  gnu: Add GHC 8.6.5

 gnu/packages/haskell.scm | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

-- 
2.20.1 (Apple Git-117)





Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 15:49:02 GMT) Full text and rfc822 format available.

Message #8 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: 36692 <at> debbugs.gnu.org
Cc: Robert Vollmert <rob <at> vllmrt.net>
Subject: [PATCH 1/2] gnu: Rename ghc-8 to ghc-8.4
Date: Tue, 16 Jul 2019 17:48:40 +0200
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)





Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 15:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: 36692 <at> debbugs.gnu.org
Cc: Robert Vollmert <rob <at> vllmrt.net>
Subject: [PATCH 2/2] gnu: Add GHC 8.6.5
Date: Tue, 16 Jul 2019 17:48:41 +0200
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)





Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 16:02:02 GMT) Full text and rfc822 format available.

Message #14 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: 36692 <at> debbugs.gnu.org
Subject: test failures
Date: Tue, 16 Jul 2019 18:00:51 +0200
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"






Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 16:29:01 GMT) Full text and rfc822 format available.

Message #17 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Robert Vollmert <rob <at> vllmrt.net>, 36692 <at> debbugs.gnu.org
Subject: Re: [bug#36692] test failures
Date: Tue, 16 Jul 2019 18:28:25 +0200
[Message part 1 (text/plain, inline)]
Robert Vollmert <rob <at> 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.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 16:37:01 GMT) Full text and rfc822 format available.

Message #20 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 36692 <at> debbugs.gnu.org
Subject: Re: [bug#36692] test failures
Date: Tue, 16 Jul 2019 18:36:35 +0200

> On 16. Jul 2019, at 18:28, Marius Bakke <mbakke <at> fastmail.com> wrote:
> 
> Robert Vollmert <rob <at> 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?





Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 16:46:01 GMT) Full text and rfc822 format available.

Message #23 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Marius Bakke <mbakke <at> fastmail.com>
To: Robert Vollmert <rob <at> vllmrt.net>
Cc: 36692 <at> debbugs.gnu.org
Subject: Re: [bug#36692] test failures
Date: Tue, 16 Jul 2019 18:45:31 +0200
[Message part 1 (text/plain, inline)]
Robert Vollmert <rob <at> vllmrt.net> writes:

>> On 16. Jul 2019, at 18:28, Marius Bakke <mbakke <at> fastmail.com> wrote:
>> 
>> Robert Vollmert <rob <at> 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
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 18:59:01 GMT) Full text and rfc822 format available.

Message #26 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: 36692 <at> debbugs.gnu.org
Cc: Robert Vollmert <rob <at> vllmrt.net>
Subject: [PATCH 2/2] gnu: ghc <at> 8.6.5: Skip failing tests
Date: Tue, 16 Jul 2019 20:58:36 +0200
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)





Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 18:59:02 GMT) Full text and rfc822 format available.

Message #29 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: 36692 <at> debbugs.gnu.org
Cc: Robert Vollmert <rob <at> vllmrt.net>
Subject: [PATCH 1/2] gnu: ghc <at> 8.6.5: Duplicate build arguments from ghc-8.4
Date: Tue, 16 Jul 2019 20:58:35 +0200
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)





Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 19:01:01 GMT) Full text and rfc822 format available.

Message #32 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 36692 <at> debbugs.gnu.org
Subject: Re: [bug#36692] test failures
Date: Tue, 16 Jul 2019 21:00:31 +0200

> On 16. Jul 2019, at 18:28, Marius Bakke <mbakke <at> fastmail.com> wrote:
> 
> Robert Vollmert <rob <at> 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.





Information forwarded to guix-patches <at> gnu.org:
bug#36692; Package guix-patches. (Tue, 16 Jul 2019 19:49:01 GMT) Full text and rfc822 format available.

Message #35 received at 36692 <at> debbugs.gnu.org (full text, mbox):

From: Robert Vollmert <rob <at> vllmrt.net>
To: 36692 <at> debbugs.gnu.org
Cc: Robert Vollmert <rob <at> vllmrt.net>
Subject: [PATCH (unified, replaces previous patches)] gnu: Add GHC 8.6.5
Date: Tue, 16 Jul 2019 21:47:41 +0200
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)





Reply sent to Timothy Sample <samplet <at> ngyro.com>:
You have taken responsibility. (Thu, 08 Aug 2019 04:27:01 GMT) Full text and rfc822 format available.

Notification sent to Robert Vollmert <rob <at> vllmrt.net>:
bug acknowledged by developer. (Thu, 08 Aug 2019 04:27:02 GMT) Full text and rfc822 format available.

Message #40 received at 36692-done <at> debbugs.gnu.org (full text, mbox):

From: Timothy Sample <samplet <at> ngyro.com>
To: Robert Vollmert <rob <at> vllmrt.net>
Cc: 36692-done <at> debbugs.gnu.org
Subject: Re: [bug#36692] [PATCH (unified,
 replaces previous patches)] gnu: Add GHC 8.6.5
Date: Thu, 08 Aug 2019 00:26:39 -0400
Hi Robert,

Robert Vollmert <rob <at> 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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 05 Sep 2019 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 234 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.