Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxPython 4.2.1 does not compile with GCC 14 #2493

Closed
qookei opened this issue Dec 3, 2023 · 10 comments
Closed

wxPython 4.2.1 does not compile with GCC 14 #2493

qookei opened this issue Dec 3, 2023 · 10 comments

Comments

@qookei
Copy link

qookei commented Dec 3, 2023

Operating system: Gentoo Linux
wxPython version & source: Distro wxPython 4.2.1
Python version & source: Distro Python 3.11

Description of the problem:

GCC 14 makes -Wincompatible-pointer-types (among others) error out by default, so the build fails with the following error:

[  9/929] Compiling sip/siplib/siplib.c
16:38:17 runner ['x86_64-pc-linux-gnu-gcc', '-UNDEBUG', '-pthread', '-O3', '-O3', '-march=znver2', '-pipe', '-ggdb3', '-pthread', '-fPIC', '-pthread', '-pthread', '-I/usr/include/gtk-3.0', '-I/usr/include/pango-1.0', '-I/usr/include/glib-2.
0', '-I/usr/lib64/glib-2.0/include', '-I/usr/lib64/libffi/include', '-I/usr/include/harfbuzz', '-I/usr/include/freetype2', '-I/usr/include/libmount', '-I/usr/include/blkid', '-I/usr/include/fribidi', '-I/usr/include/cairo', '-I/usr/include/
libpng16', '-I/usr/include/pixman-1', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/atk-1.0', '-I/usr/include/at-spi2-atk/2.0', '-I/usr/include/at-spi-2.0', '-I/usr/include/dbus-1.0', '-I/usr/lib64/dbus-1.0
/include', '-pthread', '-UNDEBUG', '-g', '-I/usr/lib64/wx/include/gtk3-unicode-3.2-gtk3', '-I/usr/include/wx-3.2-gtk3', '-Isip/siplib', '-I../../../../sip/siplib', '-Iwx/include', '-I../../../../wx/include', '-Isrc', '-I../../../../src', '-
I/usr/include/python3.11', '-DPYTHONDIR="/usr/local/lib/python3.11/site-packages"', '-DPYTHONARCHDIR="/usr/local/lib/python3.11/site-packages"', '-DHAVE_PYEXT=1', '-DHAVE_PYTHON_H=1', '-DHAVE_WX=1', '-DHAVE_WXADV=1', '-DHAVE_WXSTC=1', '-DHA
VE_WXHTML=1', '-DHAVE_WXGL=1', '-DHAVE_WXXML=1', '-DHAVE_WXXRC=1', '-DHAVE_WXRICHTEXT=1', '-DHAVE_WXMEDIA=1', '-DHAVE_WXRIBBON=1', '-DHAVE_WXPROPGRID=1', '-DHAVE_WXAUI=1', '-D_FILE_OFFSET_BITS=64', '-DWXUSINGDLL', '-D__WXGTK__', '../../../.
./sip/siplib/siplib.c', '-c', '-o/var/tmp/portage/dev-python/wxpython-4.2.1/work/wxPython-4.2.1-python3_11/build/waf/3.11/gtk3/sip/siplib/siplib.c.1.o', '-DNDEBUG', '-DNDEBUG']
../../../../sip/siplib/siplib.c: In function ‘parsePass1’:
../../../../sip/siplib/siplib.c:3905:20: error: assignment to ‘sipSimpleWrapper *’ {aka ‘struct _sipSimpleWrapper *’} from incompatible pointer type ‘PyObject *’ {aka ‘struct _object *’} [-Wincompatible-pointer-types]
 3905 |             *selfp = va_arg(va, PyObject *);
      |                    ^

@qookei
Copy link
Author

qookei commented Dec 3, 2023

Hmm, this actually seems to be a bug in SIP itself.

@swt2c
Copy link
Collaborator

swt2c commented Dec 3, 2023

Yes, I reported it to SIP upstream.

@swt2c
Copy link
Collaborator

swt2c commented Dec 9, 2023

Fixed in sip (not yet released): https://www.riverbankcomputing.com/hg/sip/rev/afc99fa84d0d

@qookei
Copy link
Author

qookei commented Dec 16, 2023

Thanks for reporting it upstream! Closing as wxPython compiles fine with SIP 6.8.1.

@qookei qookei closed this as completed Dec 16, 2023
@tfmoraes
Copy link

I'm trying to install from pypi using pip in Fedora 40 (GCC 14) and having this issue. Is it possible to force run sip when using pip install?

@swt2c
Copy link
Collaborator

swt2c commented Apr 1, 2024

I'm trying to install from pypi using pip in Fedora 40 (GCC 14) and having this issue. Is it possible to force run sip when using pip install?

On Fedora 40, you can just install wxPython with dnf install python3-wxpython4 and not have to compile it yourself...

@tfmoraes
Copy link

tfmoraes commented Apr 1, 2024

I know. But the same problem will happen in other linux distro with gcc14 and without wxpython package.

@cfcurtis
Copy link

Same issue here on Fedora 40, I did some digging and realized that while it is fixed in source, the release on PyPi includes an old version of SIP. Are there plans to update it anytime soon?

I know I can build from source or use the rpm, but I have wxPython as a dependency in my project and it's nice when other people can just pip install without having to find workarounds.

@swt2c
Copy link
Collaborator

swt2c commented May 30, 2024

See #2553

@mixmid
Copy link

mixmid commented Jul 16, 2024

This patch has helped me.

gcc_14.zip

But i will appreciate if someone tells how to patch source files before compilation in a python way, i.e. to download wxPython-4.2.1.tar.gz, unpack, then patch, after build by

$ pip install wxPython

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants