Skip to content

Commit

Permalink
math/py-numpy: work around build issue on -CURRENT
Browse files Browse the repository at this point in the history
A sched_getaffinity function has been added to -CURRENT and the
Python build detects it presence and provides a Python function
os.sched_getaffinity().

Apparently the C library function is not correctly wrapped and
returns an out of buounds result.

Comment out the call of os.sched_getaffinity() call until this
function works correctly in the Python interpreter.

No port revision bump, since this is just a temporary fix for the
broken build on -CURRENT.

Reported by:	antoine
  • Loading branch information
stesser committed Jan 2, 2022
1 parent 5f0be63 commit 507c189
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions math/py-numpy/files/patch-numpy_distutils_misc__util.py
@@ -0,0 +1,16 @@
--- numpy/distutils/misc_util.py.orig 2022-01-02 20:27:35 UTC
+++ numpy/distutils/misc_util.py
@@ -92,9 +92,9 @@ def get_num_build_jobs():
"""
from numpy.distutils.core import get_distribution
- try:
- cpu_count = len(os.sched_getaffinity(0))
- except AttributeError:
- cpu_count = multiprocessing.cpu_count()
+# try:
+# cpu_count = len(os.sched_getaffinity(0))
+# except AttributeError:
+ cpu_count = multiprocessing.cpu_count()
cpu_count = min(cpu_count, 8)
envjobs = int(os.environ.get("NPY_NUM_BUILD_JOBS", cpu_count))

0 comments on commit 507c189

Please sign in to comment.