Tue Dec 8 08:53:16 2020 UTC ()
Apply a workaround for NetBSD to the testyield.ml test.

On NetBSD, the "thread scheduler" appears to just schedule two
threads out of 4 when all they in essence to is "yield", and not
do round-robin scheduling, causing the test to loop.  Reduce the
number of threads in the test to 2.

Bump PKGREVISION.

OK'ed by jaapb@


(he)
diff -r1.136 -r1.137 pkgsrc/lang/ocaml/Makefile
diff -r0 -r1.1 pkgsrc/lang/ocaml/patches/patch-testsuite_tests_lib-systhreads_testyield.ml

cvs diff -r1.136 -r1.137 pkgsrc/lang/ocaml/Makefile (expand / switch to unified diff)

--- pkgsrc/lang/ocaml/Makefile 2020/12/01 23:44:00 1.136
+++ pkgsrc/lang/ocaml/Makefile 2020/12/08 08:53:16 1.137
@@ -1,19 +1,21 @@ @@ -1,19 +1,21 @@
1# $NetBSD: Makefile,v 1.136 2020/12/01 23:44:00 he Exp $ 1# $NetBSD: Makefile,v 1.137 2020/12/08 08:53:16 he Exp $
2 2
3.include "Makefile.common" 3.include "Makefile.common"
4 4
5#CONFIGURE_ENV+= disable_x11=yes 5#CONFIGURE_ENV+= disable_x11=yes
6 6
 7PKGREVISION= 1
 8
7BUILD_TARGET= world 9BUILD_TARGET= world
8MAKE_JOBS_SAFE= no 10MAKE_JOBS_SAFE= no
9UNLIMIT_RESOURCES= stacksize 11UNLIMIT_RESOURCES= stacksize
10 12
11USE_TOOLS+= bash 13USE_TOOLS+= bash
12USE_LANGUAGES+= c 14USE_LANGUAGES+= c
13USE_LIBTOOL= yes 15USE_LIBTOOL= yes
14USE_GNU_CONFIGURE_HOST= no 16USE_GNU_CONFIGURE_HOST= no
15 17
16# This actually works fine, but requires some patches that the maintainer 18# This actually works fine, but requires some patches that the maintainer
17# insists on removing every time the package is updated, so we unfortunately 19# insists on removing every time the package is updated, so we unfortunately
18# have to mark it broken to stop wasting people's valuable time investigating. 20# have to mark it broken to stop wasting people's valuable time investigating.
19BROKEN_ON_PLATFORM= SunOS-*-* 21BROKEN_ON_PLATFORM= SunOS-*-*

File Added: pkgsrc/lang/ocaml/patches/patch-testsuite_tests_lib-systhreads_testyield.ml
$NetBSD: patch-testsuite_tests_lib-systhreads_testyield.ml,v 1.1 2020/12/08 08:53:16 he Exp $

Reduce the number of threads to 2, so that we don't loop forever
on NetBSD, where the scheduler appears to only alternate between
two threads instead of doing round-robin scheduling.

Ref. https://github.com/ocaml/ocaml/issues/10067

--- testsuite/tests/lib-systhreads/testyield.ml.orig	2020-03-18 15:02:03.000000000 +0000
+++ testsuite/tests/lib-systhreads/testyield.ml
@@ -7,7 +7,7 @@
    ** native
 *)
 
-let threads = 4
+let threads = 2
 
 let are_ready = ref 0