wxWidgets / Phoenix

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

WAF build in venv fails due to python-config output parsing #2477

Open Tristan971 opened 7 months ago

Tristan971 commented 7 months ago

Operating system: Linux (Fedora 39) wxPython version & source: 4.2.1 from source Python version & source: Stock 3.10.13 via PyEnv

Description of the problem:

The build fails with the following error:

  Running command: build_py
  Checking for /tmp/tmpz108wmnq/wxPython-4.2.1/bin/waf-2.0.24...
  "/tmp/tmpnqs7wx48/.venv/bin/python" /tmp/tmpz108wmnq/wxPython-4.2.1/bin/waf-2.0.24 --wx_config=/tmp/tmpz108wmnq/wxPython-4.2.1/build/wxbld/gtk3/wx-config --gtk3 --python="/tmp/tmpnqs7wx48/.venv/bin/python" --out=build/waf/3.10/gtk3 configure build 
  Setting top to                           : /tmp/tmpz108wmnq/wxPython-4.2.1 
  Setting out to                           : /tmp/tmpz108wmnq/wxPython-4.2.1/build/waf/3.10/gtk3 
  Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
  Checking for 'g++' (C++ compiler)        : /usr/bin/g++ 
  Checking for program 'python'            : /tmp/tmpnqs7wx48/.venv/bin/python 
  Checking for python version >= 3.7.0     : 3.10.13 
  python-config                            : /home/tristan/.pyenv/shims/python3.10-config 
  Asking python-config for pyext '--cflags --libs --ldflags' flags : not found 
  The configuration failed
  (complete log in /tmp/tmpz108wmnq/wxPython-4.2.1/build/waf/3.10/gtk3/config.log)
  Command '"/tmp/tmpnqs7wx48/.venv/bin/python" /tmp/tmpz108wmnq/wxPython-4.2.1/bin/waf-2.0.24 --wx_config=/tmp/tmpz108wmnq/wxPython-4.2.1/build/wxbld/gtk3/wx-config --gtk3 --python="/tmp/tmpnqs7wx48/.venv/bin/python" --out=build/waf/3.10/gtk3 configure build ' failed with exit code 1.
  Finished command: build_py (0.674s)
  Finished command: build (1m2.111s)
  WARNING: Building this way assumes that all generated files have been 
  generated already.  If that is not the case then use build.py directly 
  to generate the source and perform the build stage.  You can use 
  --skip-build with the bdist_* or install commands to avoid this 
  message and the wxWidgets and Phoenix build steps in the future.

  "/tmp/tmpnqs7wx48/.venv/bin/python" -u build.py build
  Command '"/tmp/tmpnqs7wx48/.venv/bin/python" -u build.py build' failed with exit code 1.

It's a bit noisy but I believe the issue is:

Asking python-config for pyext '--cflags --libs --ldflags' flags : not found 

Which is surprising because:

$ python-config --cflags --libs --ldflags
-I/home/tristan/.pyenv/versions/3.10.13/include/python3.10 -I/home/tristan/.pyenv/versions/3.10.13/include/python3.10  -Wno-unused-result -Wsign-compare  -DNDEBUG -g -fwrapv -O3 -Wall
 -lcrypt -ldl  -lm -lm 
 -L/home/tristan/.pyenv/versions/3.10.13/lib  -lcrypt -ldl  -lm -lm 

Does this somehow look like an odd output for it? Because afaict it's the same as my system Python one:

$ python-config --cflags --libs --ldflags
-I/usr/include/python3.12 -I/usr/include/python3.12  -fno-strict-overflow -Wsign-compare -fcf-protection -fexceptions   -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -fcf-protection -fexceptions 
 -ldl  -lm 
 -L/usr/lib64  -ldl  -lm

Well, admittedly there a few duplicated flags in my venv's Python for whatever reason... :thinking:

Tristan971 commented 7 months ago

Seems like a WAF issue, so I raised https://gitlab.com/ita1024/waf/-/issues/2420, and over there it seems like it might be a PyEnv issue... Waiting for feedback from upstream for now.

Lucas-Froguel commented 6 months ago

Any update on the issue @Tristan971? I saw there on gitlab they recommended you spoke with people from pyenv, had any luck with them?

Tristan971 commented 6 months ago

Unfortunately I didn't pursue further at that point, since getting to that already took longer than I could afford on it... :/ I ended up installing the binary wheel

Lucas-Froguel commented 6 months ago

I bet. I've spent quite some hours figuring this out before I stumbled here. Unfortunately, there are no wheels for arch, so I'm kinda stuck not being able to use it.

Lucas-Froguel commented 5 months ago

If you are coming here from ARCH/ARCH based distros trying to build WXPython, I think that is currently not possible, however I did manage do use the ubuntu22.04 pre-built wheels made available by the developers and it did run properly, given I had to install libtiff.so.5 via yay -S libtiff5. Not great, but at least it worked.

adam-coates commented 1 month ago

@Lucas-Froguel Thanks for the tip, I tried 3 hours yesterday and spent only 5 minutes after reading your comment and managed to get wxpython on arch.