Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Jan 2026 16:26:23 +0000
From:      Ganael LAPLANCHE <martymac@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: c8af973fb559 - main - devel/onetbb: Fix the last failing test
Message-ID:  <6974f2af.37f47.626ce62c@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by martymac:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c8af973fb559ebd09ebfede81d7ad6f2e7ddd456

commit c8af973fb559ebd09ebfede81d7ad6f2e7ddd456
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2026-01-24 16:23:26 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2026-01-24 16:23:26 +0000

    devel/onetbb: Fix the last failing test
    
    Fix the following test:
    
     63 - test_hw_concurrency (ILLEGAL)
    
    by using sched_getaffinity().
    
    PR:     292088
    Reported by:    diizzy
---
 devel/onetbb/Makefile                              |  2 +-
 ...-test_common_utils_concurrency_limit.h-affinity | 57 ++++++++++++++++++++++
 2 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/devel/onetbb/Makefile b/devel/onetbb/Makefile
index 1f6c85407312..b3aa564c554e 100644
--- a/devel/onetbb/Makefile
+++ b/devel/onetbb/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	onetbb
 DISTVERSIONPREFIX=	v
 DISTVERSION=	2022.3.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	devel
 
 MAINTAINER=	martymac@FreeBSD.org
diff --git a/devel/onetbb/files/patch-test_common_utils_concurrency_limit.h-affinity b/devel/onetbb/files/patch-test_common_utils_concurrency_limit.h-affinity
new file mode 100644
index 000000000000..3a1e9a401bf4
--- /dev/null
+++ b/devel/onetbb/files/patch-test_common_utils_concurrency_limit.h-affinity
@@ -0,0 +1,57 @@
+Add affinity support
+
+Fixes test 63:
+
+63 - test_hw_concurrency (Subprocess aborted)
+
+--- test/common/utils_concurrency_limit.h.orig	2026-01-24 10:55:17 UTC
++++ test/common/utils_concurrency_limit.h
+@@ -91,16 +91,21 @@ static int get_max_procs() {
+                 ++nproc;
+         }
+         maxProcs = nproc;
+-#elif __linux__
+-        cpu_set_t mask;
++#elif __linux__ || __FreeBSD__
+         int result = 0;
++#if __linux__
++        cpu_set_t mask;
+         sched_getaffinity(0, sizeof(cpu_set_t), &mask);
++#else /* __FreeBSD__ */
++        cpuset_t mask;
++        sched_getaffinity(0, sizeof(cpuset_t), &mask);
++#endif
+         int nproc = sysconf(_SC_NPROCESSORS_ONLN);
+         for (int i = 0; i < nproc; ++i) {
+             if (CPU_ISSET(i, &mask)) ++result;
+         }
+         maxProcs = result;
+-#else // FreeBSD
++#else
+         maxProcs = sysconf(_SC_NPROCESSORS_ONLN);
+ #endif
+     }
+@@ -328,9 +333,14 @@ std::vector<int> get_cpuset_indices() {
+ 
+ std::vector<int> get_cpuset_indices() {
+     std::vector<int> result;
++#if __linux__ || __FreeBSD__
+ #if __linux__
+     cpu_set_t mask;
+     sched_getaffinity(0, sizeof(cpu_set_t), &mask);
++#else /* __FreeBSD__ */
++    cpuset_t mask;
++    sched_getaffinity(0, sizeof(cpuset_t), &mask);
++#endif
+     int nproc = sysconf(_SC_NPROCESSORS_ONLN);
+     for (int i = 0; i < nproc; ++i) {
+         if (CPU_ISSET(i, &mask)) {
+@@ -339,7 +349,7 @@ std::vector<int> get_cpuset_indices() {
+     }
+     ASSERT(!result.empty(), nullptr);
+ #else
+-    // TODO: add affinity support for Windows and FreeBSD
++    // TODO: add affinity support for Windows
+ #endif
+     return result;
+ }


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6974f2af.37f47.626ce62c>