Bug 2245598 - libsigrokdecode fails to build with Python 3.13: error: implicit declaration of function ‘PyEval_InitThreads’
Summary: libsigrokdecode fails to build with Python 3.13: error: implicit declaration ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libsigrokdecode
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Alex G.
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-23 08:57 UTC by Karolina Surma
Modified: 2024-04-19 02:00 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-04-19 02:00:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-10-23 08:57:10 UTC
libsigrokdecode fails to build with Python 3.13.0a1.

This report is automated and not very verbose, but we'll try to get back here with details.

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/06546750-libsigrokdecode/

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

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 Miro Hrončok 2023-10-23 09:09:29 UTC
srd.c: In function ‘srd_init’:
srd.c:281:9: error: implicit declaration of function ‘PyEval_InitThreads’; did you mean ‘PyEval_SaveThread’? [-Werror=implicit-function-declaration]
  281 |         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.)

Comment 2 Alex G. 2023-10-23 17:15:05 UTC
From looking at upstream's configure.ac, they haven't yet implemented Python 3.13 support. The last change was in April 2023, to add Python 3.12 support.

We could try removing the problematic calls in Fedora's version, but I think it's better to contact upstream and have them come up with a generic fix.

Comment 3 Alex G. 2023-10-23 21:40:18 UTC
Upstream has fixed the issue in commit 0c35c5c ("srd: drop deprecated PyEval_InitThreads() on Python 3.9+").

I was trying to test this in a mock build, following the instructions from https://copr.fedorainfracloud.org/coprs/g/python/python3.13/ . However, mock consistently fails with:

        Public key for <some-package>.rpm is not installed. Failing package is: zstd-1.5.5-4.fc39.x86_64
         GPG Keys are configured as: file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-39-primary, file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-39-primary, file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-38-primary
        Error: GPG check FAILED

How do I get past this?

Comment 4 Miro Hrončok 2023-10-24 10:46:03 UTC
Do you have up-to-date mock, mock-core-config, mock-core-configs, distribution-gpg-keys?

Comment 5 Alex G. 2023-10-24 15:56:18 UTC
Updating the aforementioned packages solved the issue. Thank you!

I pushed upstrean's fix to https://src.fedoraproject.org/rpms/libsigrokdecode/c/e77894683a529eb7ec1b405c9106f0f1bbf6152a?branch=rawhide

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