Bug 2260316 - openscap fails to build with Python 3.13: error: implicit declaration of function ‘PyEval_InitThreads’
Summary: openscap fails to build with Python 3.13: error: implicit declaration of func...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: openscap
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Ambroz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-01-25 08:54 UTC by Karolina Surma
Modified: 2024-04-03 12:54 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2024-01-25 08:54:06 UTC
openscap fails to build with Python 3.13.03.

Mitigating the distutils issue made it possible for this error to appear:

/builddir/build/BUILD/openscap-1.3.9/redhat-linux-build/swig/python3/CMakeFiles/_openscap_py.dir/openscapPYTHON_wrap.c: In function ‘rule_result_output_callback_wrapper’:
/builddir/build/BUILD/openscap-1.3.9/redhat-linux-build/swig/python3/CMakeFiles/_openscap_py.dir/openscapPYTHON_wrap.c:3896:14: error: implicit declaration of function ‘PyEval_CallObject’; did you mean ‘PyObject_CallObject’? [-Wimplicit-function-declaration]
 3896 |     result = PyEval_CallObject(func,arglist);
      |              ^~~~~~~~~~~~~~~~~
      |              PyObject_CallObject
/builddir/build/BUILD/openscap-1.3.9/redhat-linux-build/swig/python3/CMakeFiles/_openscap_py.dir/openscapPYTHON_wrap.c: In function ‘xccdf_policy_model_register_output_callback_py’:
/builddir/build/BUILD/openscap-1.3.9/redhat-linux-build/swig/python3/CMakeFiles/_openscap_py.dir/openscapPYTHON_wrap.c:4072:5: error: implicit declaration of function ‘PyEval_InitThreads’; did you mean ‘PyEval_SaveThread’? [-Wimplicit-function-declaration]
 4072 |     PyEval_InitThreads();
      |     ^~~~~~~~~~~~~~~~~~
      |     PyEval_SaveThread

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

Remove PyEval_InitThreads() and PyEval_ThreadsInitialized() functions, deprecated in Python 3.9.
Since Python 3.7, Py_Initialize() always creates the GIL:
calling PyEval_InitThreads() did nothing and PyEval_ThreadsInitialized() always returned non-zero.
(Contributed by Victor Stinner in https://github.com/python/cpython/issues/105182.)


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/06941745-openscap/

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

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 Michal Ambroz 2024-01-26 02:28:24 UTC
https://github.com/OpenSCAP/openscap/issues/2077

Comment 2 Michal Ambroz 2024-01-26 02:32:27 UTC
Evgeny do I assume it right you are already dealing with this upstream?

Comment 3 Evgeny Kolesnikov 2024-01-30 19:49:46 UTC
No, we do not. It is highly unlikely it would be an upstream priority until it hits Rawhide.

Comment 4 Michal Ambroz 2024-01-31 21:02:18 UTC
mkey ... thanks for info.
I will take the ticket for now, not sure I would be able to change the interface myself.

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


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