Open JacekRuzyczka opened 11 months ago
By default, wxPython builds its own copy of wxWidgets, so it should not use your system copy.
Is this the entirety of the log? What happened before Finished command: build_wx (1m21.690s)
? That's suspicious because it should take longer than 82 seconds..
Does this mean that the necessary wx/setup.h
must be added to the wxPython-4.2.1.tar.gz
package before starting the build? I've just tried that out, but no use: The "fatal error" disappears, but the three warnings about the missing setup.h
at /tmp/pip-req-build-2qaqrik2/build/wxbld/gtk3/lib64/wx/include/gtk3-unicode-3.2
persist, and a new error message appears:
../../../../ext/wxWidgets/include/wx/chkconf.h:287:9: error: #error "wxUSE_SPELLCHECK must be defined, please read comment near the top of this file."
The package does contain three files with settings
or setup
in their respective names, though:
Please find attached the complete build log.
I think the issue might be two mismatched libdirs. If you look at your build.log, the setup.h seems to be being created in lib:
config.status: creating lib/wx/include/gtk3-unicode-3.2/wx/setup.h
However, wxPython then tries to find it in lib64:
WARNING: Unable to find setup.h in /tmp/pip-req-build-2qaqrik2/build/wxbld/gtk3/lib64/wx/include/gtk3-unicode-3.2, assuming wxUSE_GLCANVAS is not available.
I am not sure what to do about it, though. I think the issue might be with wxWidgets' wx-config script.
See #1067, it seems to be the same issue. You might be able to do a hacky workaround by symlinking lib64 to lib while wxWidgets is building.
So the issue has been existing for five years and hasn't been resolved yet…?
So the issue has been existing for five years and hasn't been resolved yet…?
Unfortunately, yes. As with many projects, the number of bugs approaches infinity, while the number of active developers approaches zero. I did try again to reproduce the problem yesterday, but I was unable to. So, it seems we need to figure out the difference.
:-/
I've managed to implant the missing #define wxUSE_SPELLCHECK 0
into the setup.h
file, but now I'm stumbling upon a bunch of even stranger error messages, which imply an inconsistency in the C sources:
In file included from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30:0,
from /usr/include/gtk-3.0/gdk/gdk.h:32,
from /usr/include/gtk-3.0/gdk/gdkx.h:28,
from ../../../../sip/cpp/sip_corewxWindow.cpp:48:
/usr/include/gtk-3.0/gdk/gdktypes.h:143:39: error: conflicting declaration ‘typedef struct _GdkWindow GdkWindow’
typedef struct _GdkWindow GdkWindow;
^~~~~~~~~
In file included from ../../../../ext/wxWidgets/include/wx/wx.h:14:0,
from ../../../../wx/include/wxPython/wxpy_api.h:41,
from ../../../../sip/cpp/sipAPI_core.h:22068,
from ../../../../sip/cpp/sip_corewxWindow.cpp:10:
../../../../ext/wxWidgets/include/wx/defs.h:3146:33: note: previous declaration as ‘typedef struct _GdkDrawable GdkWindow’
typedef struct _GdkDrawable GdkWindow;
^~~~~~~~~
../../../../sip/cpp/sip_corewxWindow.cpp: In function ‘wxUIntPtr wxPyGetWinHandle(const wxWindow*)’:
../../../../sip/cpp/sip_corewxWindow.cpp:66:75: error: ‘GtkWidget {aka struct _GtkWidget}’ has no member named ‘window’
GDK_WINDOW_XWINDOW((wxwin)->m_wxwindow->window) : \
^
../../../../sip/cpp/sip_corewxWindow.cpp:66:75: note: in definition of macro ‘GetXWindow’
GDK_WINDOW_XWINDOW((wxwin)->m_wxwindow->window) : \
^~~~~~
../../../../sip/cpp/sip_corewxWindow.cpp:66:35: error: ‘GDK_WINDOW_XWINDOW’ was not declared in this scope
GDK_WINDOW_XWINDOW((wxwin)->m_wxwindow->window) : \
^
../../../../sip/cpp/sip_corewxWindow.cpp:66:35: note: in definition of macro ‘GetXWindow’
GDK_WINDOW_XWINDOW((wxwin)->m_wxwindow->window) : \
^~~~~~~~~~~~~~~~~~
../../../../sip/cpp/sip_corewxWindow.cpp:66:35: note: suggested alternative: ‘GDK_WINDOW_XID’
GDK_WINDOW_XWINDOW((wxwin)->m_wxwindow->window) : \
^
../../../../sip/cpp/sip_corewxWindow.cpp:66:35: note: in definition of macro ‘GetXWindow’
GDK_WINDOW_XWINDOW((wxwin)->m_wxwindow->window) : \
^~~~~~~~~~~~~~~~~~
../../../../sip/cpp/sip_corewxWindow.cpp:67:73: error: ‘GtkWidget {aka struct _GtkWidget}’ has no member named ‘window’
GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
^
../../../../sip/cpp/sip_corewxWindow.cpp:67:73: note: in definition of macro ‘GetXWindow’
GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)
^~~~~~
Waf: Leaving directory `/tmp/pip-req-build-l5xef92v/build/waf/3.11/gtk3'
Build failed
This is the part of defs.h
in question:
#if defined(__WXGTK3__)
typedef struct _GdkWindow GdkWindow;
typedef struct _GdkEventSequence GdkEventSequence;
#elif defined(__WXGTK20__)
typedef struct _GdkDrawable GdkWindow;
typedef struct _GdkDrawable GdkPixmap;
#else
typedef struct _GdkWindow GdkWindow;
typedef struct _GdkWindow GdkBitmap;
typedef struct _GdkWindow GdkPixmap;
#endif
Does _GdkWindow
inherit from _GdkDrawable
? If yes, there will be only a small sourcecode correction necessary, but nobody knows how many mistakes are hidden beyond this blunder.
OK, I've made some advancements with patching wxPython:
_GdkWindow
seems to disappear after upgrading to version 4.2.1.setup_inc.h
to setup.h
and made numerous patches. See below.// Recommended setting: 1, setting it to 0 may be useful to avoid dependencies
// on libcurl on Unix systems.
#define wxUSE_WEBREQUEST 0
// Patch for wxPython 4.2.1.
// Added 2023/07/02 by JR.
#define wxUSE_LIBMSPACK 1
#define wxUSE_XTEST 1
#define wxUSE_SELECT_DISPATCHER 1
#define wxHAS_INOTIFY 1
BUT: I've stumbled over a very strange error with the bitmap types of wxWidgets
I can't find anywhere on the web:
In file included from ../../../../sip/cpp/sip_corewxZoomGestureEvent.cpp:10:0:
../../../../sip/cpp/sipAPI_core.h:22143:9: error: ‘wxNativePixelData’ does not name a type; did you mean ‘sipType_wxNativePixelData’?
typedef wxNativePixelData::Iterator wxNativePixelData_Accessor;
^~~~~~~~~~~~~~~~~
sipType_wxNativePixelData
../../../../sip/cpp/sipAPI_core.h:22144:9: error: ‘wxAlphaPixelData’ does not name a type; did you mean ‘wxFileData’?
typedef wxAlphaPixelData::Iterator wxAlphaPixelData_Accessor;
^~~~~~~~~~~~~~~~
wxFileData
Adding a line like #include "../../ext/wxWidgets/include/wx/rawbmp.h"
at the beginning of sipAPI_core.h
did NOT help. Neither did editing lines 22144 & 22145 as suggested by the compiler:
typedef sipType_wxNativePixelData::Iterator sipType_wxNativePixelData_Accessor;
typedef sipType_wxAlphaPixelData::Iterator sipType_wxAlphaPixelData_Accessor;
The types in question are documented here: https://docs.wxwidgets.org/3.0/classwx_pixel_data.html According to the doc, both types, which seem to miss in your code, are implemented on Windows, MacOS X, and Gtk+. So. Why does whis error appear then?
I hate to say it but I think you're wasting time going down that path. I'd suggest just starting a wxPython install, then while wxWidgets is building, figure out the /tmp directory and symlink lib to lib64 as was done in the other ticket.
@swt2c Just tried it out with a fresh tarball. It was in fact three lib
folders I had to link to lib64
.
The other lib
folders lies somewhere under ext
and wx
, respectively. And:
Building wheel for wxPython (setup.py): finished with status 'done'
Created wheel for wxPython: filename=wxPython-4.2.1-cp311-cp311-linux_x86_64.whl size=140090452 sha256=2c32e6acb6fded5553ca57d5ece8822b7f2253ff1d35835cada2bbdb4dab6cf9
Stored in directory: /home/jacek/.cache/pip/wheels/8a/91/cd/81fc9c0ae845eda7af8cde172c55c8503f36d759b88f7b7afe
Successfully built wxPython
╭─jacek@epica ~
╰─➤ pip install wxPython-4.2.1-cp311-cp311-linux_x86_64.whl
Defaulting to user installation because normal site-packages is not writeable
Processing ./wxPython-4.2.1-cp311-cp311-linux_x86_64.whl
Requirement already satisfied: pillow in ./.local/lib/python3.11/site-packages (from wxPython==4.2.1) (10.0.0)
Requirement already satisfied: six in ./.local/lib/python3.11/site-packages (from wxPython==4.2.1) (1.16.0)
Requirement already satisfied: numpy in ./.local/lib/python3.11/site-packages (from wxPython==4.2.1) (1.25.0)
Installing collected packages: wxPython
Successfully installed wxPython-4.2.1
BUT: Even if the workaround with the lib64
symlinks to lib64
may lead to success, please note that it's unsuitable for productive use, so may someone please (!!!) adjust the build script so that it will create these symlinks automatically. Thank you.
Yes, I'm not suggesting that's a permanent solution, just a workaround.
As far as fixing the root of the issue, can you please provide the output of cat /etc/os-release
and also rpm -qa
so that I can try to figure out why I couldn't reproduce this on OpenSuSE 15.5 when I tried.
╭─jacek@epica ~
╰─➤ cat /etc/os-release
NAME="openSUSE Leap"
VERSION="15.5"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.5"
PRETTY_NAME="openSUSE Leap 15.5"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.5"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Leap"
LOGO="distributor-logo-Leap"
Installed packages see the file attached.
Thank you for the package list. The good news is that I was able to reproduce it with that information. The problem is reproducible if the python3-wxPython
package is installed. Still investigating...it's unclear yet whether the wxPython package itself is causing the problem, or whether it's the wxWidgets packages that get pulled in with it.
OK, so I lied. This has nothing to do with the python3-wxPython
package. In fact, it has to do with the site-config
package which gets installed when you install make
. The reason I didn't see this right away is that site-config
sets environment variables that don't get set until you log out and log back in. This is in fact a wxWidgets bug with the wx-config that gets generated.
Reported upstream: https://github.com/wxWidgets/wxWidgets/issues/23737
OpenSuSE 15.5 Linux (x86_64): 4.2.1 via PyPi: 3.11.2-150400.9.5.3 via official OpenSuSE repo:
File wx/setup.h missing when trying to install wxPython by using pip (despite being installed on my machine)