Bug 2246291 - cryptlib fails to build with Python 3.13: error: implicit declaration of function ‘PyObject_AsWriteBuffer’, ‘PyObject_AsCharBuffer’
Summary: cryptlib fails to build with Python 3.13: error: implicit declaration of func...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cryptlib
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ralf Senderek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-26 07:48 UTC by Karolina Surma
Modified: 2023-11-06 15:25 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-11-06 15:25:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-10-26 07:48:10 UTC
cryptlib fails to build with Python 3.13.0a1.

python.c: In function ‘getPointerWrite’:
python.c:23:9: error: implicit declaration of function ‘PyObject_AsWriteBuffer’; did you mean ‘PyObject_GetBuffer’? [-Werror=implicit-function-declaration]
   23 |     if (PyObject_AsWriteBuffer(objPtr, (void **)bytesPtrPtr, &size) == -1)
      |         ^~~~~~~~~~~~~~~~~~~~~~
      |         PyObject_GetBuffer
python.c: In function ‘getPointerRead’:
python.c:47:13: error: implicit declaration of function ‘PyObject_AsCharBuffer’; did you mean ‘PyObject_CheckBuffer’? [-Werror=implicit-function-declaration]
   47 |         if (PyObject_AsCharBuffer(objPtr, (const char **)bytesPtrPtr, &size) == -1)
      |             ^~~~~~~~~~~~~~~~~~~~~
      |             PyObject_CheckBuffer


https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06546751-cryptlib/

For all our attempts to build cryptlib with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/cryptlib/

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

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Ralf Senderek 2023-11-01 15:08:11 UTC
I have updated the source code to Cryptlib version 3.4.7-1 in RAWHIDE.

The source code of python.c is now based entirely on the new Buffer Protocol using  PyObject_GetBuffer() only.
The offending old wrapper functions PyObject_AsWriteBuffer() and PyObject_AsCharBuffer() are deleted 
everywhere. All my tests of python code that uses the new Cryptlib python library show that the changed
code is fully functional.

A new Cryptlib version has been build for RAWHIDE : https://bodhi.fedoraproject.org/updates/FEDORA-2023-5c1e41b85c

Please check if the 3.4.7-1 build in RAWHIDE  builds with Python 3.13.0a1 in copr and if so, 
please close this bug.

Thanks.


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