Bug 2245785 - freeradius fails to build with Python 3.13: error: implicit declaration of function ‘PyEval_InitThreads’, 'PyEval_AcquireLock', 'PyEval_ReleaseLock'
Summary: freeradius fails to build with Python 3.13: error: implicit declaration of fu...
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: freeradius
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Antonio Torres
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-24 07:27 UTC by Karolina Surma
Modified: 2024-02-15 23:00 UTC (History)
6 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)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-10493 0 None None None 2023-10-24 07:28:10 UTC

Description Karolina Surma 2023-10-24 07:27:30 UTC
freeradius fails to build with Python 3.13.0a1.

src/modules/rlm_python3/rlm_python3.c: In function ‘python_interpreter_free’:
src/modules/rlm_python3/rlm_python3.c:683:9: error: implicit declaration of function ‘PyEval_AcquireLock’; did you mean ‘PyEval_AcquireThread’? [-Werror=implicit-function-declaration]
  683 |         PyEval_AcquireLock();
      |         ^~~~~~~~~~~~~~~~~~
      |         PyEval_AcquireThread
src/modules/rlm_python3/rlm_python3.c:686:9: error: implicit declaration of function ‘PyEval_ReleaseLock’; did you mean ‘PyEval_ReleaseThread’? [-Werror=implicit-function-declaration]
  686 |         PyEval_ReleaseLock();
      |         ^~~~~~~~~~~~~~~~~~
      |         PyEval_ReleaseThread
src/modules/rlm_python3/rlm_python3.c: In function ‘python_interpreter_init’:
src/modules/rlm_python3/rlm_python3.c:1123:25: error: implicit declaration of function ‘Py_SetProgramName’; did you mean ‘Py_GetProgramName’? [-Werror=implicit-function-declaration]
 1123 |                         Py_SetProgramName(name);                /* The value of argv[0] as a wide char string */
      |                         ^~~~~~~~~~~~~~~~~
      |                         Py_GetProgramName
src/modules/rlm_python3/rlm_python3.c:1136:17: error: implicit declaration of function ‘PyEval_InitThreads’; did you mean ‘PyEval_SaveThread’? [-Werror=implicit-function-declaration]
 1136 |                 PyEval_InitThreads();                   /* This also grabs a lock (which we then need to release) */
      |                 ^~~~~~~~~~~~~~~~~~
      |                 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.)

- Remove PyEval_AcquireLock() and PyEval_ReleaseLock() functions, deprecated in Python 3.2. They didn’t update the current thread state. They can be replaced with:
    PyEval_SaveThread() and PyEval_RestoreThread();
    low-level PyEval_AcquireThread() and PyEval_RestoreThread();
    or PyGILState_Ensure() and PyGILState_Release().
(Contributed by Victor Stinner in gh-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/06546780-freeradius/

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

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 Antonio Torres 2023-10-25 07:20:12 UTC
Upstream PR https://github.com/FreeRADIUS/freeradius-server/pull/5208

Comment 2 Aoife Moloney 2024-02-15 23:00:39 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.