wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.21k stars 509 forks source link

wxPython 4.2.1 build failed with cython 3.0.8 and sip 6.8.1 #2514

Open JohnPritchard opened 4 months ago

JohnPritchard commented 4 months ago

I'm getting the same problem as reported in https://github.com/wxWidgets/Phoenix/issues/2439, building in MacPorts, with the following versions:

wxpython @4.2.1 sip @6.8.1 cython @3.0.8

I get this for python 3.9.18, 3.10.13 & 3.11.7

This probably stopped working in MacPorts ~2 weeks ago (23/12/2023) when the cython version (in MacPorts) was upgraded from 0.29.36 to 3.0.7. Building wxpython also failed against python 3.0.7. The python version in MacPorts was upgraded from 3.0.7 to 3.0.8 yesterday (11/01/2024).

Note, although in MacPorts the source tgz (of wxpython) is (typically) not downloaded directly from PyPI, the sha256 checksum of the MacPorts and the PyPI source tgz's are identical, so it is the same source as provided by PyPI.

JohnPritchard commented 4 months ago

For the record, the build error is:

:info:build Waf: Entering directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-wxpython-4.0/py39-wxpython-4.0/work/wxPython-4.2.1/build/waf/3.9' :info:build *** Compiler: /usr/bin/clang --version :info:build Apple clang version 15.0.0 (clang-1500.1.0.2.5) :info:build Target: arm64-apple-darwin23.2.0 :info:build Thread model: posix :info:build InstalledDir: /Library/Developer/CommandLineTools/usr/bin :info:build Waf: Leaving directory '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-wxpython-4.0/py39-wxpython-4.0/work/wxPython-4.2.1/build/waf/3.9' :info:build 'build' finished successfully (2.274s) :info:build Compiling wx/svg/_nanosvg.pyx because it changed. :info:build [1/1] Cythonizing wx/svg/_nanosvg.pyx :info:build Error compiling Cython file: :info:build ------------------------------------------------------------ :info:build ... :info:build for manipulating the SVG shape info in memory. :info:build """ :info:build import sys :info:build cimport cython.object :info:build ^ :info:build ------------------------------------------------------------ :info:build wx/svg/_nanosvg.pyx:45:8: 'cython.object' is not a valid cython. module :info:build Traceback (most recent call last): :info:build File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-wxpython-4.0/py39-wxpython-4.0/work/wxPython-4.2.1/setup-wxsvg.py", line 54, in :info:build modules = cythonize([module], :info:build File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize :info:build cythonize_one(*args) :info:build File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one :info:build raise CompileError(None, pyx_file) :info:build Cython.Compiler.Errors.CompileError: wx/svg/_nanosvg.pyx

swt2c commented 4 months ago

Yes, the fix isn't in wxPython 4.2.1. You either need to pick up this patch: https://github.com/wxWidgets/Phoenix/commit/aeb557d01e7cd37176ebbf0f1ae6d0b53c115378 or use Cython < 3 as a workaround for now.

JohnPritchard commented 4 months ago

Great! Thanks for the pointer. I will try out applying the patch, and if that works ask the MacPorts maintainer to officially add the patch to the MacPorts build.