Page MenuHome

blender 2.93.1 fails to build with python 3.10.0b4 (upcoming python 3.10)
Needs Triage, NormalPublic

Description

blender 2.93.1 fails to build with python 3.10.0 beta 4 (released 2021-07-10).
Error messages are:

/builddir/build/BUILD/blender-2.93.1/source/blender/python/mathutils/mathutils.c: In function 'mathutils_array_hash':
/builddir/build/BUILD/blender-2.93.1/source/blender/python/mathutils/mathutils.c:98:24: error: incompatible type for argument 1 of '_Py_HashDouble'
   98 |     y = _Py_HashDouble((double)(array[i++]));
      |                        ^~~~~~~~~~~~~~~~~~~~
      |                        |
      |                        double
In file included from /usr/include/python3.10/Python.h:90,
                 from /builddir/build/BUILD/blender-2.93.1/source/blender/python/mathutils/mathutils.c:21:
/usr/include/python3.10/pyhash.h:10:38: note: expected 'PyObject *' {aka 'struct _object *'} but argument is of type 'double'
   10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
      |                                      ^~~~~~~~~~
/builddir/build/BUILD/blender-2.93.1/source/blender/python/mathutils/mathutils.c:98:9: error: too few arguments to function '_Py_HashDouble'
   98 |     y = _Py_HashDouble((double)(array[i++]));
      |         ^~~~~~~~~~~~~~
In file included from /usr/include/python3.10/Python.h:90,
                 from /builddir/build/BUILD/blender-2.93.1/source/blender/python/mathutils/mathutils.c:21:
/usr/include/python3.10/pyhash.h:10:23: note: declared here
   10 | PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
      |                       ^~~~~~~~~~~~~~

python 3.10 release schedule is https://www.python.org/dev/peps/pep-0619/

Perhaps this is due to the following change:
https://github.com/python/cpython/commit/a07da09ad5bd7d234ccd084a3a0933c290d1b592#diff-457f8bf30255da716d2a556ad1bef2dff5d77ed1511f3328da22c600bb477042R10
https://bugs.python.org/issue43475

numpy changed like this: https://github.com/numpy/numpy/commit/ad2a73c18dcff95d844c382c94ab7f73b5571cf3