python-alsa fails to build with Python 3.10.0a3. In file included from /usr/include/python3.10/tupleobject.h:39, from /usr/include/python3.10/Python.h:105, from pyalsa/common.h:25, from pyalsa/alsahcontrol.c:22: pyalsa/alsahcontrol.c: In function ‘element_callback’: /usr/include/python3.10/cpython/tupleobject.h:26:36: error: void value not ignored as it ought to be 26 | #define PyTuple_SET_ITEM(op, i, v) ((void)(_PyTuple_CAST(op)->ob_item[i] = v)) | ^ pyalsa/alsahcontrol.c:1546:21: note: in expansion of macro ‘PyTuple_SET_ITEM’ 1546 | if (PyTuple_SET_ITEM(t, 0, (PyObject *)pyhelem)) | ^~~~~~~~~~~~~~~~ error: command '/usr/bin/gcc' failed with exit code 1 bpo-30459: PyList_SET_ITEM(), PyTuple_SET_ITEM() and PyCell_SET() macros can no longer be used as l-value or r-value. For example, x = PyList_SET_ITEM(a, b, c) and PyList_SET_ITEM(a, b, c) = x now fail with a compiler error. It prevents bugs like if (PyList_SET_ITEM (a, b, c) < 0) ... test. Patch by Zackery Spytz and Victor Stinner. For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01819274-python-alsa/ For all our attempts to build python-alsa with Python 3.10, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-alsa/ Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/ Let us know here if you have any questions. Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
Apply also commit a64a6cc703d08db5c223a16bf812a569534ba464 (alsaseq: fix constant objects in Python) https://github.com/alsa-project/alsa-python/commit/a64a6cc703d08db5c223a16bf812a569534ba464
The correct patch subject mentioned in comment#1 is "alsaseq: fix constant objects in Python 3", sorry.
> Apply also commit a64a6cc703d08db5c223a16bf812a569534ba464 (alsaseq: fix constant objects in Python) This change looks unrelated, whereas the following change fix this BZ: https://github.com/alsa-project/alsa-python/commit/5ea2f8709b4d091700750661231f8a3ddce0fc7c
> https://github.com/alsa-project/alsa-python/commit/5ea2f8709b4d091700750661231f8a3ddce0fc7c This fix is already in the package: https://src.fedoraproject.org/rpms/python-alsa/c/5f7266bb79fa11732cbf33f719f86a94323a3a14?branch=master The package now builds succesfully on Python 3.10: https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-alsa/ I close again the BZ. Thanks for the fix!