Bug 2245803 - libsolv fails to build with Python 3.13: error: implicit declaration of function ‘PyEval_CallObject’; did you mean ‘PyObject_CallObject’?
Summary: libsolv fails to build with Python 3.13: error: implicit declaration of funct...
Keywords:
Status: CLOSED COMPLETED
Alias: None
Product: Fedora
Classification: Fedora
Component: libsolv
Version: rawhide
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Evan Goode
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-24 08:02 UTC by Karolina Surma
Modified: 2024-05-07 09:17 UTC (History)
11 users (show)

Fixed In Version: libsolv-0.7.29-1.fc41
Clone Of:
Environment:
Last Closed: 2024-05-07 08:06:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-10-24 08:02:19 UTC
libsolv fails to build with Python 3.13.0a1.

/builddir/build/BUILD/libsolv-0.7.25/redhat-linux-build/bindings/python/solv_python.c:4734:24: error: implicit declaration of function ‘PyEval_CallObject’; did you mean ‘PyObject_CallObject’? [-Werror=implicit-function-declaration]
 4734 |     PyObject *result = PyEval_CallObject((PyObject *)d, args);
      |                        ^~~~~~~~~~~~~~~~~
      |                        PyObject_CallObject

According to https://docs.python.org/3.13/whatsnew/3.13.html:
Remove PyEval_CallObject(), PyEval_CallObjectWithKeywords(): use PyObject_CallNoArgs() or PyObject_Call() instead.
Warning: PyObject_Call() positional arguments must be a tuple and must not be NULL,
keyword arguments must be a dict or NULL, whereas removed functions checked arguments type and accepted NULL positional and keyword arguments.
To replace PyEval_CallObjectWithKeywords(func, NULL, kwargs) with PyObject_Call(),
pass an empty tuple as positional arguments using PyTuple_New(0).

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/06560409-libsolv/

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

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 Jan Kolarik 2023-12-05 12:08:57 UTC
libsolv uses swig for generating Python bindings. I believe that when swig is switched to being built using Python 3.13, this issue will be automatically resolved.

Comment 2 Miro Hrončok 2023-12-05 12:17:23 UTC
What exactly do you mean by "swig is switched to being built using Python 3.13"?

Comment 3 Miro Hrončok 2023-12-05 12:21:19 UTC
Is this file generated by swig or used as input for swig?

https://github.com/openSUSE/libsolv/blob/master/bindings/solv.i

The git history suggests it's used as input. It has:


    PyObject *result = PyEval_CallObject((PyObject *)d, args);

Comment 4 Jan Kolarik 2023-12-05 12:28:24 UTC
Oh, thanks. I see it now. I assumed, based on the log output in the first comment, that it was really coming from the generated swig code, following swig's IDL. I overlooked this explicit Python construct. I will submit an upstream issue for that or create a PR to fix it there.

Comment 5 Miro Hrončok 2023-12-05 12:35:46 UTC
For the record, replacing that with:

    PyObject *result = PyObject_Call((PyObject *)d, args, NULL);

Makes the package build. I have not tested it any further than that and I have not checked if this works on all the Python versions libsolv claims to support.

Comment 6 Jan Kolarik 2023-12-05 12:46:06 UTC
Nice, thanks for trying that.

Comment 7 Jan Kolarik 2024-02-09 14:08:21 UTC
Upstream PR created: https://github.com/openSUSE/libsolv/pull/551.

Comment 8 Jan Kolarik 2024-02-13 15:09:01 UTC
Merged upstream.

Comment 9 Aoife Moloney 2024-02-15 23:00:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 10 Miro Hrončok 2024-04-23 12:30:19 UTC
Installable python3-solv is a requirement to install @critical-path-compose, raising priority.

Please backport the upstream fix.

Comment 11 Miro Hrončok 2024-05-06 09:56:24 UTC
Should we wait for you to backport/update or do the backport ourselves?

Comment 12 Jan Kolarik 2024-05-06 10:03:23 UTC
I will ping our current release master regarding this. There is already an upstream release including the fix, so it should an easy rebase.

Comment 13 Miro Hrončok 2024-05-07 09:17:54 UTC
Thank you!


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