[Bug 263939] python3.8 os.sched_getaffinity(0); broken on arm64?

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 12 May 2022 13:22:22 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263939

Bjoern A. Zeeb <bz@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kib@FreeBSD.org
            Summary|math/py-numpy -- error on   |python3.8
                   |build                       |os.sched_getaffinity(0);
                   |                            |broken on arm64?
           See Also|https://bugs.freebsd.org/bu |
                   |gzilla/show_bug.cgi?id=2596 |
                   |37                          |

--- Comment #3 from Bjoern A. Zeeb <bz@FreeBSD.org> ---
Renaming this as it seems the actual problem is in python itself (also removing
the see-also).

On amd64 with python 3.8 installed from pkg I get:

% python3.8
Python 3.8.13 (default, Apr 28 2022, 01:23:51) 
[Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a
on freebsd14
Type "help", "copyright", "credits" or "license" for more information.
>>> import os;
>>> os.sched_getaffinity(0);
{0, 1, 2, 3, 4, 5, 6, 7}
>>> quit();
%

On arm64 where I am building I get:

# python3.8
Python 3.8.13 (default, May 11 2022, 17:57:27) 
[Clang 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a
on freebsd14
Type "help", "copyright", "credits" or "license" for more information.
>>> import os;
>>> os.sched_getaffinity(0);
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OSError: [Errno 0] Error
>>> quit();
#


I can see a difference on an older installation where the problem was that the
function wasn't present yet to my reading (again here on arm64 but probably in
general);  the change is probably driven by @kib's changes to sched.h in src
last year so it became supported?

# python3.8
Python 3.8.10 (default, Jul 10 2021, 10:18:40) 
[Clang 12.0.1 (git@github.com:llvm/llvm-project.git llvmorg-12.0.1-rc2-0-ge7dac
on freebsd14
Type "help", "copyright", "credits" or "license" for more information.
>>> import os;
>>> os.sched_getaffinity(0);
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'os' has no attribute 'sched_getaffinity'
>>> quit();
#

-- 
You are receiving this mail because:
You are the assignee for the bug.