Bug 2155427

Summary: python-giacpy fails to build with Python 3.12: error: _PyUnicode_Ready was not declared in this scope
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-giacpyAssignee: Antonio T. sagitter <trpost>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: frederic.han, mhroncok, thrnciar, trpost
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-01-20 10:50:20 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: 2155702    
Bug Blocks: 2135404    

Description Tomáš Hrnčiar 2022-12-21 08:47:51 UTC
python-giacpy fails to build with Python 3.12.0a3.

giacpy/giacpy.cpp:595:51: error: ‘_PyUnicode_Ready’ was not declared in this scope; did you mean ‘PyUnicode_READY’?
  595 |                                               0 : _PyUnicode_Ready((PyObject *)(op)))
      |                                                   ^~~~~~~~~~~~~~~~

Leagcy Unicode APIs has been removed. See PEP 623 for detail.
        PyUnicode_WCHAR_KIND
        PyUnicode_AS_UNICODE()
        PyUnicode_AsUnicode()
        PyUnicode_AsUnicodeAndSize()
        PyUnicode_AS_DATA()
        PyUnicode_FromUnicode()
        PyUnicode_GET_SIZE()
        PyUnicode_GetSize()
        PyUnicode_GET_DATA_SIZE()

https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05128847-python-giacpy/

For all our attempts to build python-giacpy with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/python-giacpy/

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.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
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 Frederic Han 2022-12-26 15:55:37 UTC
Indeed but the file giacpy.cpp is created by cython. Deleting it and recythonzing with python3.12 didn't help me with pip version of cython, but with this fix I was able to built giacpy.

 
https://github.com/cython/cython/commit/b4595a04a78b79dc59276a9f64aab7b884e945e8

Comment 2 Tomáš Hrnčiar 2023-01-20 10:50:20 UTC
I patched Cython and this error is fixed although another error causing failures also on rawhide. I won't bugzilla for that because relengs will open it automatically after the mass rebuild is finished.