Bug 2245870 - python-gmpy2 fails to build with Python 3.13: error: implicit declaration of function ‘_PyLong_New’
Summary: python-gmpy2 fails to build with Python 3.13: error: implicit declaration of...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python-gmpy2
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jerry James
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-24 12:03 UTC by Karolina Surma
Modified: 2024-07-07 17:45 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-07-07 17:45:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-10-24 12:03:29 UTC
python-gmpy2 fails to build with Python 3.13.0a1.

In file included from src/gmpy2.c:605:
  src/gmpy2_convert_gmp.c: In function ‘GMPy_PyLong_From_MPZ’:
  src/gmpy2_convert_gmp.c:174:20: error: implicit declaration of function ‘_PyLong_New’ [-Werror=implicit-function-declaration]
    174 |     if (!(result = _PyLong_New(size))) {
        |                    ^~~~~~~~~~~
  In file included from src/gmpy2.c:648:
  src/gmpy2_hash.c: In function ‘_mpfr_hash’:
  src/gmpy2_hash.c:189:12: error: implicit declaration of function ‘_Py_HashDouble’ [-Werror=implicit-function-declaration]
    189 |     return _Py_HashDouble(temp);
        |            ^~~~~~~~~~~~~~

This function has been removed from Python 3.13.
The detailed list of the removed private C API functions can be found here:
https://github.com/python/cpython/issues/106320


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/06551072-python-gmpy2/

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

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 Jerry James 2023-10-24 14:40:52 UTC
Gmpy2 upstream has requested information on:
- a _PyLong_New replacement: https://github.com/python/cpython/pull/108604
- a _Py_HashDouble replacement: https://github.com/python/cpython/pull/107026

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

Comment 3 Jerry James 2024-07-07 17:45:44 UTC
Upstream kept the needed interfaces for python 3.13, so I am closing this bug for now.  The problem will resurface with python 3.14, but gmpy2 upstream is working with python upstream to craft a solution.


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