unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#36692] [PATCH 0/2] Add GHC 8.6.5
@ 2019-07-16 15:47 Robert Vollmert
  2019-07-16 15:48 ` [bug#36692] [PATCH 1/2] gnu: Rename ghc-8 to ghc-8.4 Robert Vollmert
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Robert Vollmert @ 2019-07-16 15:47 UTC (permalink / raw)
  To: 36692; +Cc: Robert Vollmert

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)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [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] [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] 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 (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

end of thread, other threads:[~2019-08-08  4:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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
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
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   ` [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
2019-08-08  4:26   ` bug#36692: " Timothy Sample

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).