Bug 2054236 - util-linux fails to build with Python 3.11: error: unknown type name 'Py_buffer'
Summary: util-linux fails to build with Python 3.11: error: unknown type name 'Py_buffer'
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2022-02-14 13:47 UTC by Tomáš Hrnčiar
Modified: 2022-06-22 11:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-22 11:49:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2022-02-14 13:47:22 UTC
util-linux fails to build with Python 3.11.0a4.

In file included from /usr/include/python3.11/object.h:733,
                 from /usr/include/python3.11/Python.h:42,
                 from libmount/python/pylibmount.h:4,
                 from libmount/python/fs.c:28:
/usr/include/python3.11/cpython/object.h:50:42: error: unknown type name 'Py_buffer'
   50 | typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
      |                                          ^~~~~~~~~
/usr/include/python3.11/cpython/object.h:51:47: error: unknown type name 'Py_buffer'
   51 | typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
      |                                               ^~~~~~~~~
/usr/include/python3.11/cpython/object.h:134:6: error: unknown type name 'getbufferproc'
  134 |      getbufferproc bf_getbuffer;
      |      ^~~~~~~~~~~~~
/usr/include/python3.11/cpython/object.h:135:6: error: unknown type name 'releasebufferproc'
  135 |      releasebufferproc bf_releasebuffer;
      |      ^~~~~~~~~~~~~~~~~

Py_buffer and APIs are now part of the limited API and the stable ABI:
    PyObject_CheckBuffer()
    PyObject_GetBuffer()
    PyBuffer_GetPointer()
    PyBuffer_SizeFromFormat()
    PyBuffer_ToContiguous()
    PyBuffer_FromContiguous()
    PyBuffer_CopyData()
    PyBuffer_IsContiguous()
    PyBuffer_FillContiguousStrides()
    PyBuffer_FillInfo()
    PyBuffer_Release()
    PyMemoryView_FromBuffer()
    bf_getbuffer and bf_releasebuffer type slots

(Contributed by Christian Heimes in bpo-45459.)

https://bugs.python.org/issue45459
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/03442720-util-linux/

For all our attempts to build util-linux with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/util-linux/

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.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
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 Miro Hrončok 2022-06-22 11:49:14 UTC
Closing this in bulk as it built with Python 3.11. If this needs to remain open for a followup, feel free to reopen, I won't close in bulk again.


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