~ruther/guix-local

b2881fc187e56366dd75540b7871748080d28dcd — Jason Conroy 8 months ago fae7b63
gnu: ocaml: make test suite run faster with less flakiness.

* gnu/packages/ocaml.scm (ocaml-5.0):
[arguments]:
<#:parallel-tests?>: disable.
<#:phases>{enable-parallel-tests}: patch `tests` build target to enable
parallelism via GNU Parallel.
[native-inputs]: add `parallel`.

* gnu/packages/ocaml.scm: (ocaml-5.3): inherits the changes above via `ocaml-5.0`.

Change-Id: I0d25350a04b89585f5526cedbf7420d51d40ab34
Signed-off-by: Julien Lepiller <julien@lepiller.eu>
1 files changed, 11 insertions(+), 1 deletions(-)

M gnu/packages/ocaml.scm
M gnu/packages/ocaml.scm => gnu/packages/ocaml.scm +11 -1
@@ 75,6 75,7 @@
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages node)
  #:use-module (gnu packages parallel)
  #:use-module (gnu packages pcre)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)


@@ 216,16 217,25 @@ This package produces a native @command{ocamlc} and a bytecode @command{ocamllex
            (files (list "lib/ocaml/site-lib/stubslibs"
                         "lib/ocaml/site-lib/stublibs")))))
    (native-inputs
     (list perl pkg-config))
     (list parallel perl pkg-config))
    (inputs
     (list libx11 libiberty ;needed for objdump support
           zlib))                       ;also needed for objdump support
    (arguments
     `(#:configure-flags '("--enable-ocamltest")
       #:test-target "tests"
       ;; This doesn't have the desired effect and makes test runs less
       ;; stable. See https://codeberg.org/guix/guix/pulls/2933.
       #:parallel-tests? #f
       #:make-flags '("defaultentry")
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'enable-parallel-tests
           (lambda _
             ;; Patch the `tests` build target to enable a special parallel
             ;; execution mode based on GNU Parallel.
             (substitute* "Makefile"
               (("-C testsuite all") "-C testsuite parallel"))))
         (add-after 'unpack 'patch-/bin/sh-references
           (lambda* (#:key inputs #:allow-other-keys)
             (let* ((sh (search-input-file inputs "/bin/sh"))