wxWidgets / Phoenix

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

Targetting MSYS2 #1582

Open sancelot opened 4 years ago

sancelot commented 4 years ago

Operating system:win10 / MSYS2 wxPython version & source: 4.0.7.post2 Python version & source: distro python 3.8.0

Description of the problem: Hi, I would need wxPython 4.0 ins MSYS2 I tried compiling . At first I would like to understand why it want to try to download and build waf since it is already in my system . but if it is only a python dependency that may not be very important.

I then have problems detecting gcc compiler with waf from the build_py command, it seems targetting msvc altough I hacked a bit build.py

but if I run 'waf configure build' from my shell I have more accurate details : Setting top to : /home/steph/MINGW-packages/mingw-w64-wxPython4.0/src/wxPython-4.0.7.post2 Setting out to : /home/steph/MINGW-packages/mingw-w64-wxPython4.0/src/wxPython-4.0.7.post2/build/waf Checking for 'clang' (C compiler) : not found Checking for 'gcc' (C compiler) : /mingw64/bin/gcc Checking for 'clang++' (C++ compiler) : not found Checking for 'g++' (C++ compiler) : /mingw64/bin/g++ Checking for program 'python' : /usr/bin/python3.exe Checking for python version >= 2.7.0 : 3.7.4 python-config : /usr/bin/python3.7-config Asking python-config for pyext '--cflags --libs --ldflags' flags : yes Testing pyext configuration : Could not build python extensions Testing pyext configuration : Could not build python extensions

RobinD42 commented 4 years ago

At first I would like to understand why it want to try to download and build waf

The build.py script expects by default to use specific versions of waf, sip, and doxygen. There is a bin/waf-* included in the source tarfile, but if it doesn't match the MD5 (for example, if line-endings were changed when it was unpacked) then it will download a fresh copy.

Testing pyext configuration : Could not build python extensions

If you haven't already please take a look at the log from waf's configure step, probably build/waf/3.8/config.log. You should see there the C code it used to test if it's able to build Python extensions, and the errors that it ran into. That info may point you to the source of the problem.

stambaughw commented 4 years ago

The build.py script expects by default to use specific versions of waf, sip, and doxygen. There is a bin/waf-* included in the source tarfile, but if it doesn't match the MD5 (for example, if line-endings were changed when it was unpacked) then it will download a fresh copy.

@RobinD42 By specific versions do you mean some minimum version or an exact version? The KiCad project currently uses msys2 as our build system on windows so we've been shipping Python2 and wxPython2 on windows because Phoenix does not build on msys2 so I would really like to see this work completed.

@sancelot Do you have a public branch of your build.py changes on GitHub? I would like to take a look at them if possible.

RobinD42 commented 4 years ago

Specific versions. See build.py starting around line 88. You can supply your own versions of those tools, if needed, by setting their paths in environment variables SIP, WAF and DOXYGEN.

RobinD42 commented 4 years ago

Also, in case it wasn't clear, if you build from a source tarball instead of a git checkout, then all you need is waf.

stambaughw commented 4 years ago

AFIACT, the issue is not with sip, waf, or doxygen all of which are packaged by msys2. The problem appears to be the call to checkCompler() in build.py. The assumption in checkCompiler() is that if the platform is windows that the compiler is always msvc. Passing COMPILER=mingw32 to setup.py doesn't respect the platform configuration performed by Pythons distutils which used work correctly in wxPython2. I'm not sure why checkCompiler() is even doing any of this msvc configuration. Unless something changed, Python's distutils should do all of this for you. If it doesn't configure the compiler exactly the way you like, you should be able to pass any necessary compiler options on the command line during configuration. checkCompiler() should not assume that the compiler on windows is msvc and respect the developers preference.

pvgoran commented 3 years ago

It would be good if Phoenix could be built with msys2/mingw. Python2 gets removed from everywhere, and the msys2 ecosystem (which is also in process of purging python2) faces the risk of losing a wxPython implementation.

ustsv commented 3 years ago

PKGBUILD for msys2/mingw. Build git version [Draft]. Anyone interested, test it. Mix setup.py build.py /usr/bin/python waf. I couldn't parse all the scripts py, isWindows and Shell kills me. Using the tools included in msys2. Unit test successfully partially. Demo works almost all. Build kicad-git with KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON successfully. https://bitbucket.org/ustsv/testpkg_msys2/src/master/mingw-w64-wxpython-phoenix-git/

stambaughw commented 3 years ago

Hi Sergey,

Great work! This would give us another build option if the MSVC package builds do not pan out in time for the V6 release. Unfortunately I don't have access to a Windows machine at the moment so my ability to test this is zero.

Would one of our windows msys2 devs give this a spin and see if you can get wxPhoenix and KiCad to build on msys2?

It might make sense to try to build the latest release version of wxPhoenix rather than git HEAD. I know there can be some compatibility issues with wxWidgets HEAD compared to a released version of wxWidgets.

Shouldn't wxPhoenix have python3 and wxWidgets-3.1 as dependencies rather than python and wxWidgets?

Cheers,

Wayne

On 1/30/21 10:18 AM, Sergey Ustinov wrote:

PKGBUILD for msys2/mingw. Build git version [Draft]. Anyone interested, test it. Mix setup.py build.py /usr/bin/python waf. I couldn't parse all the scripts py, isWindows and Shell kills me. Using the tools included in msys2. Unit test successfully partially. Demo works almost all. Build kicad-git with KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON successfully. https://bitbucket.org/ustsv/testpkg_msys2/src/master/mingw-w64-wxpython-phoenix-git/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wxWidgets/Phoenix/issues/1582#issuecomment-770227080, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABM6NJXWJTMX6YME4XI6PDTS4QPN7ANCNFSM4LUAYXGA.