Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1906380 - python-alsa fails to build with Python 3.10: PyList_SET_ITEM(), PyTuple_SET_ITEM() and PyCell_SET() macros can no longer be used as l-value or r-value.
Summary: python-alsa fails to build with Python 3.10: PyList_SET_ITEM(), PyTuple_SET_I...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-alsa
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-12-10 11:57 UTC by Tomáš Hrnčiar
Modified: 2020-12-14 10:00 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-14 10:00:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github alsa-project alsa-python issues 2 0 None open Fails to build with Python 3.10 2020-12-10 14:51:39 UTC

Description Tomáš Hrnčiar 2020-12-10 11:57:54 UTC
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.

Comment 1 Jaroslav Kysela 2020-12-10 15:24:34 UTC
Apply also commit a64a6cc703d08db5c223a16bf812a569534ba464 (alsaseq: fix constant objects in Python)

https://github.com/alsa-project/alsa-python/commit/a64a6cc703d08db5c223a16bf812a569534ba464

Comment 2 Jaroslav Kysela 2020-12-10 15:28:06 UTC
The correct patch subject mentioned in comment#1 is "alsaseq: fix constant objects in Python 3", sorry.

Comment 3 Victor Stinner 2020-12-14 09:58:22 UTC
> 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


Note You need to log in before you can comment on or make changes to this bug.