Bug 2247486
Summary: | grpc fails to build with Python 3.13: error: implicit declaration of function ‘PyEval_InitThreads’ | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Miro Hrončok <mhroncok> |
Component: | grpc | Assignee: | Ben Beasley <code> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | code, dan.cermak, ksurma, mhroncok |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | grpc-1.48.4-28.fc40 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-11-02 14:46:10 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 2244836 |
Description
Miro Hrončok
2023-11-01 15:03:37 UTC
I am trying with: diff --git a/src/python/grpcio/grpc/_cython/cygrpc.pyx b/src/python/grpcio/grpc/_cython/cygrpc.pyx index ca1b4c8..1a49b42 100644 --- a/src/python/grpcio/grpc/_cython/cygrpc.pyx +++ b/src/python/grpcio/grpc/_cython/cygrpc.pyx @@ -79,14 +79,9 @@ include "_cygrpc/aio/server.pyx.pxi" # # initialize gRPC # -cdef extern from "Python.h": - - int PyEval_InitThreads() - cdef _initialize(): # We have Python callbacks called by c-core threads, this ensures the GIL # is initialized. - PyEval_InitThreads() grpc_set_ssl_roots_override_callback( <grpc_ssl_roots_override_callback>ssl_roots_override_callback) As for the other error, no idea yet. (In reply to Miro Hrončok from comment #1) > I am trying with: > > […] Support for this approach: https://docs.python.org/3/c-api/init.html#c.PyEval_InitThreads > Deprecated function which does nothing. > > In Python 3.6 and older, this function created the GIL if it didn’t exist. > > Changed in version 3.9: The function now does nothing. > > Changed in version 3.7: This function is now called by Py_Initialize(), so you don’t have to call it yourself anymore. > > Changed in version 3.2: This function cannot be called before Py_Initialize() anymore. > > Deprecated since version 3.9. Since even EPEL9 has Python 3.9, I agree that this is 100% safe to remove. The other thing seems like a CYthon problem to me, reported as https://github.com/cython/cython/issues/5790 I am testing a build with Cython patched via https://github.com/cython/cython/pull/5791 (and with PyEval_InitThreads() removed from grpc). If it succeeds, could you please commit the PyEval_InitThreads() removal? I'll handle Cython itself. The build is in https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/grpc/ I need to go offline and I might not be available for the rest fo this week. (In reply to Miro Hrončok from comment #4) > I am testing a build with Cython patched via > https://github.com/cython/cython/pull/5791 (and with PyEval_InitThreads() > removed from grpc). > > If it succeeds, could you please commit the PyEval_InitThreads() removal? > I'll handle Cython itself. Sure. The call is still present in upstream master, so I’ll try to send a PR and apply it as a patch. FEDORA-2023-b55393bec7 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-b55393bec7 FEDORA-2023-b55393bec7 has been pushed to the Fedora 40 stable repository. If problem still persists, please make note of it in this bug report. > I'll handle Cython itself. https://src.fedoraproject.org/rpms/Cython/pull-request/51 |