Bug 2208211 - python-wxpython4 fails to build with Python 3.12: error: PyUnicode_GET_SIZE was not declared in this scope
Summary: python-wxpython4 fails to build with Python 3.12: error: PyUnicode_GET_SIZE w...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-wxpython4
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Scott Talbert
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2023-05-18 09:39 UTC by Tomáš Hrnčiar
Modified: 2023-06-19 20:04 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2023-06-19 20:04:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2023-05-18 09:39:03 UTC
I've tried to report this on sip mailing list, but I don't know if the message reached it because I can't see it on mailing list archive.

python-wxpython4 fails to build with Python 3.12.0a7.

../../../../sip/cpp/sip_corewxArrayString.cpp: In function ‘int convertTo_wxArrayString(PyObject*, void**, int*, PyObject*)’:
../../../../sip/cpp/sip_corewxArrayString.cpp:91:26: error: ‘PyUnicode_GET_SIZE’ was not declared in this scope; did you mean ‘PyDict_GET_SIZE’?
   91 |             size_t len = PyUnicode_GET_SIZE(item);
      |                          ^~~~~~~~~~~~~~~~~~
      |                          PyDict_GET_SIZE

This happens because of a change in CPython, where PyUnicode_GET_SIZE() was removed.

From what's new:
    Legacy Unicode APIs have 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/05903515-python-wxpython4/

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

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 Scott Talbert 2023-05-18 13:03:08 UTC
(In reply to Tomáš Hrnčiar from comment #0)
> I've tried to report this on sip mailing list, but I don't know if the
> message reached it because I can't see it on mailing list archive.

I believe you have to be a subscriber in order to post to the mailing list.

> python-wxpython4 fails to build with Python 3.12.0a7.
> 
> ../../../../sip/cpp/sip_corewxArrayString.cpp: In function ‘int
> convertTo_wxArrayString(PyObject*, void**, int*, PyObject*)’:
> ../../../../sip/cpp/sip_corewxArrayString.cpp:91:26: error:
> ‘PyUnicode_GET_SIZE’ was not declared in this scope; did you mean
> ‘PyDict_GET_SIZE’?
>    91 |             size_t len = PyUnicode_GET_SIZE(item);
>       |                          ^~~~~~~~~~~~~~~~~~
>       |                          PyDict_GET_SIZE

sip doesn't call PyUnicode_GET_SIZE, this is in some non-generated code in wxPython.  Reassigning.  I'll take a look later.

Comment 2 Scott Talbert 2023-06-13 19:22:24 UTC
I have a fix available for this particular issue, but a doxygen update in Rawhide has caused another FTBFS for wxPython.  Still working on those.


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