Invalid wxPython version string passed to CMake find_package

Bug #1801109 reported by Stefan Hamminga
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Undecided
Seth Hillbrand

Bug Description

CMake reports this error:

-- KiCad install dir: </usr>
-- Check for installed GLEW -- found
-- Boost version: 1.68.0
-- Check for installed Python Interpreter -- found
-- Python module install path: lib/python2.7/site-packages
-- wxPython/Phoenix version 4.0.0b1/gtk2 found.
CMake Error at CMakeLists.txt:822 (find_package):
  find_package called with invalid argument "4.0.0b1"

CMake Error at CMakeLists.txt:825 (include):
  include called with wrong number of arguments. include() only takes one
  file.

-- S3DSG version: 2.0.0
-- Boost version: 1.68.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Boost version: 1.68.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Boost version: 1.68.0
-- Found the following Boost libraries:
-- unit_test_framework
-- Configuring incomplete, errors occurred!

This is caused by passing a version string into the CMake "find_package" function not matching the required numerical format: "[0-9]+(\.[0-9]+){0,3}".

Adding, at line 817 of CMakeLists.txt, a string filter will remove the illegal characters from the version string:

string( REGEX MATCH "[0-9]+(\\.[0-9]+){0,3}" wxWidgets_REQ_VERSION "${wxWidgets_REQ_VERSION}" )

But the real problem is how that "b1" suffix ended up in the requested version in the first place, of course.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Hi Stefan,

It seems that Seth has already added a workaround for the problem. Could you tell me what is the output of 'import wx;print(wx.version())' executed in Python shell on your system? My suspicion is that Phoenix reports the version in the wxPython style that confuses the CMake script (if condition in line 762).

Changed in kicad:
assignee: nobody → Maciej Suminski (orsonmmz)
milestone: none → 5.1.0
Revision history for this message
Seth Hillbrand (sethh) wrote :

Hi Orson-

Yes, the commit (for me) broke python3+phoenix. For reference, here are the two versions I see on Debian Buster. I didn't see any way to correlate the Phoenix build with wx version (hence the hard-coded value).

seth@electronics-shop (master)✗ [130] % python3
Python 3.6.7 (default, Oct 21 2018, 08:08:16)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx;print(wx.version())
4.0.1 gtk3 (phoenix)

seth@electronics-shop (master)✗ % python
Python 2.7.15+ (default, Aug 31 2018, 11:56:52)
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx;print(wx.version())
3.0.2.0 gtk3 (classic)

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Uh, it is becoming more and more complex.. How about the attached patch?

Revision history for this message
Stefan Hamminga (stefanhamminga) wrote :

@Maciej:

Python 2.7.15 (default, Jun 27 2018, 13:05:28)
[GCC 8.1.1 20180531] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx;print(wx.version())
4.0.0b1 gtk2 (phoenix)

Python 3.7.1 (default, Oct 22 2018, 10:41:28)
[GCC 8.2.1 20180831] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx;print(wx.version())
4.0.3 gtk3 (phoenix) wxWidgets 3.0.4

Arch Linux stable, Python package versions:
python 3.7.1-1
python2 2.7.15-2

python-wxpython 4.0.3-4
wxgtk-common 3.0.4-2
wxgtk2 3.0.4-2
wxgtk3 3.0.4-2
wxpython-gtk2 3.0.2.0-7

The last posted patch works for me, it allows successful building for Python 3.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 672e98bd89909e5baa865c40d7f8f812fed90c82
https://git.launchpad.net/kicad/patch/?id=672e98bd89909e5baa865c40d7f8f812fed90c82

Changed in kicad:
status: New → Fix Committed
assignee: Maciej Suminski (orsonmmz) → Seth Hillbrand (sethh)
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.